How nitaid/ham10000-lesion-classification works
This repository is a HAM10000 skin-lesion classification research pipeline and single-image demo. Its main workflow prepares images and labels, creates lesion-safe (and deliberately leaky comparison) splits, trains and evaluates models, then summarizes results. Separate analyses measure lesion leakage and interpret predictions with confusion matrices and Grad-CAM. README commands document the overall workflow; source excerpts show the implementation and direct module dependencies. The dataset and run artifacts are not present in the supplied tree, so their paths are left null.
Main entry points: common.py Loading, models, metrics · predict.py Classify image and Grad-CAM · train.py Train and evaluate · interpret.py Confusion matrix and Grad-CAM
Components 15
Data preparation
- Resize and label
src/prepare_data.py - Processed images and metadata
- Split generation
src/splits.py - Lesion and image splits
Model training
- Loading, models, metrics
src/common.py - Train and evaluate
src/train.py - Run metrics, predictions, checkpoint
Evaluation and analysis
- Aggregate experiment results
src/summarize.py - Seen versus unseen analysis
src/leakage_analysis.py - Confusion matrix and Grad-CAM
src/interpret.py - Analysis outputs
results
Prediction demo
- Classify image and Grad-CAM
src/predict.py
Other components
- HAM10000 dataset
- Researcher
- Input dermatoscopic image
Connections 21
- HAM10000 dataset → Resize and label: provides images
README.md - Resize and label → Processed images and metadata: writes resized data
src/prepare_data.py - Processed images and metadata → Split generation: provides metadata
src/splits.py - Split generation → Lesion and image splits: writes splits
src/splits.py - Processed images and metadata → Loading, models, metrics: loads images
src/common.py - Lesion and image splits → Loading, models, metrics: loads split
src/common.py - Researcher → Train and evaluate: starts runs
README.md - Train and evaluate → Loading, models, metrics: uses shared utilities
src/train.py - Train and evaluate → Run metrics, predictions, checkpoint: saves metrics and model
src/train.py - Run metrics, predictions, checkpoint → Aggregate experiment results: reads run metrics
src/summarize.py - Aggregate experiment results → Analysis outputs: writes summaries
src/summarize.py - Lesion and image splits → Seen versus unseen analysis: reads image split
src/leakage_analysis.py - Run metrics, predictions, checkpoint → Seen versus unseen analysis: reads test predictions
src/leakage_analysis.py - Seen versus unseen analysis → Analysis outputs: writes leakage analysis
src/leakage_analysis.py - Run metrics, predictions, checkpoint → Confusion matrix and Grad-CAM: reads predictions and checkpoint
src/interpret.py - Confusion matrix and Grad-CAM → Loading, models, metrics: uses model and image helpers
src/interpret.py - Confusion matrix and Grad-CAM → Analysis outputs: writes figures and errors
src/interpret.py - Researcher → Classify image and Grad-CAM: requests prediction
README.md - Input dermatoscopic image → Classify image and Grad-CAM: provides image
src/predict.py - Classify image and Grad-CAM → Loading, models, metrics: builds model
src/predict.py - Run metrics, predictions, checkpoint → Classify image and Grad-CAM: loads checkpoint
src/predict.py