All projects

2026

CAMELYON17 - Metastasis Detection

Medical AI system for detecting cancerous metastases in histopathological images (H&E). Patch-level classification with CNN (ResNet, EfficientNet) and patient-level aggregation (pN-staging), with Grad-CAM interpretability.

224 px H&E patches: normal tissue on top, tumor below

Overview

This medical AI research project aims to automatically detect breast cancer metastases in histopathological images (H&E staining) using the CAMELYON17 benchmark dataset. The system performs patch-level classification (224x224 pixels) with CNN architectures (ResNet, EfficientNet), then aggregates results at the patient level for pN-stage classification (pN0 to pN3). The project addresses multi-hospital domain shift (5 sources), class imbalance, and medical interpretability via Grad-CAM and attention visualization. Priority is given to sensitivity to minimize false negatives (missed tumors).

Domain shift across 5 hospitals

Stain variation across the 5 centers, before normalization (preparation notebook)

The patches come from 5 hospitals with different staining protocols. Per-center RGB histograms show the gap before normalization; the answer is stain normalization plus histopathology-specific augmentations.

Class imbalance

Class distribution of the CAMELYON17 dataset (exploration notebook)

688,426 normal patches versus 7,392 tumor patches, so the positive class is 1.06%. The imbalance is handled with focal loss, weighted cross-entropy and batch resampling.

EfficientNet training

Training curves of the multi-center EfficientNet-B2 (training notebook)

Several CNN architectures (ResNet, EfficientNet) are trained with early stopping and checkpointing. Here the multi-center EfficientNet-B2: loss, validation AUC, sensitivity and specificity per epoch, cosine-annealed learning rate.

ROC and PR evaluation

ROC and precision-recall curves of the best model on the test set (inference notebook)

Evaluation relies on medical metrics: sensitivity, specificity, AUC-ROC. Priority goes to sensitivity to limit false negatives, hence the decision threshold marked on the ROC curve.

Patient-level aggregation

Per-node aggregation for a pN1 patient (inference notebook)

Patch-level predictions are aggregated per lymph node and then per patient for pN-stage classification (pN0 to pN3). For each patient, the ratio of patches predicted positive per node is compared to the true tumor ratio.

Challenges

  • Managing domain shift across 5 source hospitals with different staining protocols
  • Severe class imbalance between normal and tumor patches
  • Optimizing sensitivity to minimize false negatives (medical criticality)
  • Aggregating patch-level predictions to patient-level diagnosis (pN-staging)

Solutions

  • Stain normalization and histopathology-specific augmentations
  • Focal loss and weighted cross-entropy for class imbalance handling
  • ResNet and EfficientNet architectures with early stopping and checkpointing
  • Grad-CAM and attention visualization for medical interpretability

Results

  • Complete pipeline: exploration → preprocessing → training → evaluation → interpretability
  • Domain shift analysis by hospital source
  • Medical metrics: sensitivity, specificity, AUC-ROC
  • 6 Jupyter notebooks covering the end-to-end pipeline

Technologies

PythonPyTorchResNetEfficientNetGrad-CAMOpenCVScikit-learnPlotly
Next project

Apache Airflow

Project images

1 / 8