YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
GT-Skin / HAM10000 Skin Lesion Classification
This project is a Google Colab-style PyTorch notebook for multi-class skin lesion classification on the HAM10000 dataset. The workflow in Untitled2.ipynb downloads the dataset, balances the class distribution with augmentation, trains three CNN backbones, and evaluates an ensemble with test-time augmentation.
What the project does
- Loads the skin cancer dataset from Hugging Face Datasets.
- Converts the problem into 7-class classification:
nv- melanocytic nevimel- melanomabkl- benign keratosis-like lesionsbcc- basal cell carcinomaak- actinic keratosesvasc- vascular lesionsdf- dermatofibroma
- Resizes images to
299x299. - Handles class imbalance by generating augmented samples until each class reaches the target size.
- Trains three pretrained backbones:
- Xception
- EfficientNet-B5
- ConvNeXt-Base
- Uses weighted cross-entropy, label smoothing, gradient clipping, and a two-stage training schedule.
- Combines model predictions with an ensemble and test-time augmentation.
- Saves plots and checkpoints for later download.
Repository files
Untitled2.ipynb- main notebook containing the full pipeline.xcp_best.pth- saved Xception checkpoint stored as a large local artifact.b5_best.pth- saved EfficientNet-B5 checkpoint stored as a large local artifact.cvx_best.pth- saved ConvNeXt-Base checkpoint stored as a large local artifact.class_imbalance.png- class distribution plot.balance_comparison.png- before/after balancing plot.augmentation_demo.png- augmentation examples.final_results.png- final evaluation visualization.
Requirements
The notebook installs most dependencies itself, but the core stack is:
- Python 3.10+
- PyTorch
- timm
- albumentations
- datasets
- scikit-learn
- seaborn
- pandas
- matplotlib
- Pillow
How to run
In Google Colab
- Open
Untitled2.ipynbin Colab. - Run the dependency installation cell.
- Run the dataset download and preprocessing cells.
- Train the three models.
- Run the ensemble evaluation cell to generate the final metrics and plots.
Locally
The notebook is written with Colab paths such as /content/... and google.colab.files, so it is not fully local-ready without small edits. To run it locally, update the save paths and remove the Colab-specific upload/download cells.
Expected outputs
Running the notebook produces:
- Balanced training/validation/test splits.
- Saved checkpoints for each model.
- Final classification report and confusion matrix.
- PNG plots showing class imbalance, balancing, augmentation, and final results.
Notes
- The notebook is focused on classification only; it does not use segmentation masks.
- The saved
.pthfiles in the workspace are the trained model weights referenced by the notebook. - If you want, I can also turn this into a cleaner README with usage examples, environment setup, and a project diagram.
# context_free_skin