Yoann Abriel
fr

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.

Twelve 224-pixel H&E histopathology patches: normal tissue on the top row, metastases on the bottom row

fig. 01 · 224 px H&E patches: normal tissue on top, tumor below

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

One H&E patch per hospital center (0 to 4) above its RGB histogram, showing very different stains before normalization

fig. 02 · 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

Log-scale bar chart and pie chart: 688,426 normal patches, 7,392 tumor patches (1.06%)

fig. 03 · 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

Four EfficientNet-B2 training curves over 40 epochs: train and validation loss, validation AUC (best 0.9604), sensitivity and specificity, learning rate

fig. 04 · 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 curve of the best model (AUC 0.8812) with the 0.5 threshold marked, and precision-recall curve above a 0.0044 baseline

fig. 05 · 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

For patient 034 (center 1, true stage pN1), ratio of patches predicted positive for 5 nodes against the true tumor ratio, and histogram of tumor probabilities with the 0.5 threshold

fig. 06 · 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.

fig. 07

Patch-level confusion matrix: 90,411 true negatives, 22,500 false positives, 83 false negatives, 420 true positives

Patch-level confusion matrix: 83 false negatives out of 503 tumor patches, 83.5% sensitivity

fig. 08

A batch of 32 patches rebalanced by WeightedRandomSampler, each patch labeled Normal or Tumor

A batch rebalanced by WeightedRandomSampler: 14 tumors out of 32 patches

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

Python · PyTorch · ResNet · EfficientNet · Grad-CAM · OpenCV · Scikit-learn · Plotly