A deep learning pipeline for binary skin lesion classification — benign vs. malignant — built for the
ISIC 2024 Kaggle Competition (Skin Lesion Analysis Toward Melanoma Detection). The competition
targets early detection of melanoma and other skin cancers from dermoscopic images paired with rich patient
metadata, evaluated on partial AUC (pAUC) at a minimum true positive rate of 0.80 to ensure clinically
relevant sensitivity.
The primary model is an EfficientNetV2-S CNN implemented via the TIMM library (PyTorch Image
Models), trained on over 400,000 labeled samples. A parallel XGBoost baseline was developed using the 45+
patient metadata features to understand the signal available without image data.
Model Architecture
The image classification pipeline centers on EfficientNetV2-S loaded from the TIMM model
registry with ImageNet pretrained weights. The model head is replaced with a binary output for
benign/malignant classification.
Backbone: EfficientNetV2-S (TIMM) — a fused-MBConv architecture that improves training efficiency over EfficientNetV1 by replacing depthwise convolutions in early stages
Input Resolution: 224×224 RGB, with images extracted from HDF5 and decoded via PIL
Loss: Binary cross-entropy with class weighting to address the severe positive/negative imbalance
Optimizer: AdamW with cosine learning rate scheduling
Augmentation: Albumentations pipeline including random horizontal/vertical flips, rotation, brightness/contrast jitter, and normalization to ImageNet statistics
A custom PyTorch Dataset class handles on-the-fly image decoding from HDF5, keeping memory
footprint manageable at scale. Training is orchestrated with HuggingFace Accelerate
for device abstraction across CPU and GPU environments.
XGBoost Metadata Baseline
Before training the CNN, an XGBoost classifier was trained on the structured metadata alone to establish
a performance baseline and understand which features carry the most discriminative signal without any image
data. Feature engineering included:
Encoding of categorical fields (sex, anatomical site) with label and target encoding
Log-transform of skewed continuous features (lesion area, aspect ratio)
3D TBP localization coordinates and derived spatial features
Patient-level aggregation features (lesion count per patient, age-normalized size metrics)
The metadata baseline provided meaningful pAUC signal and served as a reference point for evaluating
the incremental contribution of image features. Ensemble approaches combining CNN predictions with
XGBoost metadata scores were explored as a path to improved final performance.
Training Pipeline
The end-to-end training pipeline was implemented across multiple Jupyter notebooks with modular utilities:
isic-2024-train.ipynb — EfficientNetV2-S training loop with HDF5 data loading, Albumentations augmentation, and pAUC validation tracking
isic-effnet.ipynb — Architecture exploration and hyperparameter search using the TIMM model zoo
scdetection.ipynb — End-to-end detection experiments combining image and metadata modalities
pauc.py — Custom pAUC implementation matching the competition's evaluation metric
load_metrics.ipynb — Training run analysis and cross-experiment metric comparison
The pAUC metric was implemented as a custom scoring function to enable evaluation during training,
providing alignment between the optimization objective and the competition leaderboard metric throughout
the experiment cycle.