Skip to content

avanishd-3/skin-lesion-classification

Repository files navigation

EfficientNet v2-M vs Dino v3-Base for Skin Lesion Classification

This project compares EfficientNet v2-M and DINO v3-Base on classifying skin lesions as benign or malignant.

Project Structure

Root Directory

  • README.md: Overview of the project directory structure and running instructions
  • skin_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 venv
  • pyproject.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

Directories

  • ph2_data: Files for PH2 dataset

Model Download

The trained models are available at the following Hugging Face links:

Demo Usage Instructions

Recommended Runtime (Colab)

  1. Upload demo.ipynb to Colab
  2. Zip the ph2_data folder and upload ph2_data.zipto your Colab active session
  3. Connect to a T4 Runtime (available under Runtime>change runtime type) on Colab.

Running Locally (not tested and not recommended)

  1. Install uv
  2. Clone the repository: git clone https://github.com/avanishd-3/skin-lesion-classification.git
  3. cd skin-lesion-classification
  4. Run uv sync
  5. Zip ph2_data into ph2_data.zip
  6. 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.

End-to-End Usage Instructions

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.

Getting Data

The data is from the following publicly available datasets:

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
│   │       └── ...

Recommended Runtime (Colab)

  1. Upload skin_lesion_classification.ipynb to Colab
  2. Upload the skin_lesion_classification folder to your Google Drive if you haven't already.
  3. Connect to a T4 Runtime (available under Runtime>change runtime type) on Colab.

Running Locally (not tested and not recommended)

  1. Install uv
  2. Clone the repository: git clone https://github.com/avanishd-3/skin-lesion-classification.git
  3. cd skin-lesion-classification
  4. Run uv sync
  5. Put isic-2024-challenge.zip and isic-2024-synthetic.zip into ./content/data
  6. 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.

Installing UV

See installation guide for all options.

Unix/MacOS

curl -LsSf https://astral.sh/uv/install.sh | sh

or

brew install uv

Windows

winget install --id=astral-sh.uv  -e

About

EfficientNet v2-M vs DINO v3-Base for Skin Lesion Classification

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published