This project compares EfficientNet v2-M and DINO v3-Base on classifying skin lesions as benign or malignant.
README.md: Overview of the project directory structure and running instructionsskin_lesion_classification.ipynb: The Jupyter notebook used for training, evaluating, and saving the EfficientNet and DINO models.skin_lesion_classification_local.ipynb: Version of trainig notebook for local runtime.demo.ipynb: Download the trained DINO model and run inference on the PH2 dataset..gitignore: Files for Git to ignore.python-version:Tells uv which version of Python to use when setting up venvpyproject.toml: Description of project and its dependencies- Similar to Cargo.toml
uv.lock: Hash file for project dependencies (do not edit, this is generated by uv)- Similar to pnpm-lock.yaml and Cargo.lock
ph2_data: Files for PH2 dataset
The trained models are available at the following Hugging Face links:
- Upload
demo.ipynbto Colab - Zip the ph2_data folder and upload
ph2_data.zipto your Colab active session - Connect to a T4 Runtime (available under Runtime>change runtime type) on Colab.
- Install uv
- Clone the repository: git clone https://github.com/avanishd-3/skin-lesion-classification.git
- cd skin-lesion-classification
- Run uv sync
- Zip
ph2_dataintoph2_data.zip - Run
demo.ipynb
Note: This assumes CUDA on Windows and Linux, and CPU on MacOS. If this is not the case for you, see uv Pytorch guide for updating pyproject.toml to use the correct builds for torch and torchvision.
skin_lesion_classification.ipynb takes about 3 hours to run in total on the Colab T4 Runtime. So, don't try to run this on CPU, either locally or on Colab.
The data is from the following publicly available datasets:
- https://www.kaggle.com/competitions/isic-2024-challenge
- https://www.kaggle.com/datasets/ilya9711nov/isic-2024-synthetic/data
The data is also available at this Google Drive link, which is organized for this project. To use this, download the skin_lesion_classification folder and upload it to your Google Drive (it should be in MyDrive).
If not using the Google Drive link, you must have the following zip files. The directory structure shown for isic-2024-synthetic.zip is for the unzipped file. To achieve this, delete the lr subfolders from the original dataset and flatten all the hr folders into a single images folders before zipping up your isic-2024-synthetic folder.
/
├── skin_lesion_classification
│ ├── isic-2024-challenge.zip
│ ├── isic-2024-synthetic.zip
│ │ └── images
│ │ └── IMG_NAME.png
│ │ └── ...
- Upload
skin_lesion_classification.ipynbto Colab - Upload the
skin_lesion_classificationfolder to your Google Drive if you haven't already. - Connect to a T4 Runtime (available under Runtime>change runtime type) on Colab.
- Install uv
- Clone the repository: git clone https://github.com/avanishd-3/skin-lesion-classification.git
- cd skin-lesion-classification
- Run uv sync
- Put
isic-2024-challenge.zipandisic-2024-synthetic.zipinto./content/data - Run
skin_lesion_classification_local.ipynb
Note: This assumes CUDA on Windows and Linux, and CPU on MacOS. If this is not the case for you, see uv Pytorch guide for updating pyproject.toml to use the correct builds for torch and torchvision.
See installation guide for all options.
curl -LsSf https://astral.sh/uv/install.sh | sh
or
brew install uv
winget install --id=astral-sh.uv -e