You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gradio app to detect melanoma with EigenCAM explainability
license
apache-2.0
Melanoma Classification
EfficientNet-B0 backbone fused with tabular patient metadata, trained with focal loss to handle class imbalance. Includes a Gradio inference app with EigenCAM explainability.
Setup
uv sync
Usage
All entry points go through main.py. Either --train or --app is required.
# Train with all defaults (baseline A)
uv run main.py --train
# Experiment 1 — Adam + CosineAnnealingLR
uv run main.py --train --experiment 1
# Experiment 2 — AdamW + CosineAnnealingLR
uv run main.py --train --experiment 2
# Experiment 3 — AdamW + CosineAnnealingLR + γ=1.5
uv run main.py --train --experiment 3
# Experiment 4 — image-only ablation (no metadata)
uv run main.py --train --experiment 4
# Smoke test — 1 epoch, 0 workers: verifies the full pipeline# (data loading → forward pass → loss → checkpoint → metrics JSON → plots)# Use --batch-size 64 on CUDA; keep 32 on CPU/MPS to avoid OOM
uv run main.py --train --epochs 1 --batch-size 32 --num-workers 0
# Launch the inference app locally
uv run main.py --app
# Launch the inference app with a public share link
uv run main.py --app --share
# Launch the app and force CPU inference
uv run main.py --app --device cpu
# Install the Hugging Face CLI (included in huggingface_hub)
uv pip install huggingface_hub
# Login (opens browser or prompts for token)
hf auth login
# Upload the entire output folder to the repo
hf upload burrows99/melanoma-models ./output . --repo-type model