Deep learning capstone project for classifying histopathology image patches as benign or malignant using the PatchCamelyon (PCam) dataset. The project compares a custom CNN against transfer-learning models and uses explainability techniques to interpret predictions.
- Source: PatchCamelyon β Metastatic Tissue Classification (via KaggleHub)
- Subset used: 30,000 samples (Train 18,000 / Val 6,000 / Test 6,000 β 60/20/20 split)
- Classes: Benign vs Malignant tissue patches
- Data Loading & EDA β Class distribution analysis across train/val/test splits
- Stain Normalization β Macenko normalization fitted on train data only (prevents data leakage), with before/after RGB intensity profiling
- Data Augmentation β Random flips applied via
tf.datapipeline - Modeling:
- M0: Custom 5-block residual CNN
- M1: EfficientNetB2 (transfer learning)
- M2: ResNet50V2 (transfer learning)
- M3: DenseNet121 (transfer learning)
- Evaluation: Confusion matrices, ROC & Precision-Recall curves, F1-score, Matthews Correlation Coefficient (MCC), per-class precision/recall
- Explainability: Grad-CAM visualizations across all 4 models for both classes, plus feature map extraction (early/mid/late convolutional layers)
- TensorFlow / Keras β model building & training
- KaggleHub β dataset access
- scikit-learn β evaluation metrics
- Matplotlib / Seaborn β visualization
| File | Description |
|---|---|
capstone-2 (7).ipynb |
Full notebook β data pipeline, model training, evaluation, Grad-CAM |
pcam_capstone.pptx |
Project presentation slides |
- Proper train-only fitting of stain normalization to avoid data leakage
- Side-by-side comparison of a custom CNN vs three pretrained backbones
- Full explainability suite (Grad-CAM + feature maps) for model interpretability
- Train on the full PCam dataset (beyond the 30k subset)
- Hyperparameter tuning across backbones
- Deploy best model as an inference API
Capstone project β Deep Learning / Medical Image Classification