All projects

Skin Lesion Classification via Dual-Weighted Learning

Imbalanced medical image classification using MobileViT v2 with dual-weighted learning — inverse square-root sampling + ENS loss — and Grad-CAM heatmaps for clinical interpretability.

Python
PyTorch
MobileViT v2
Computer Vision
Grad-CAM

Problem

Skin lesion datasets are severely class-imbalanced, causing standard classifiers to be biased toward majority classes while missing rare but high-risk conditions.

Approach

Dual-weighted learning: inverse square-root class sampling for batch composition, plus ENS (Effective Number of Samples) loss to balance gradient contributions. Grad-CAM for visual explanations.

Architecture

MobileViT v2 backbone → classification head. Trained with dual-weighted loss. Grad-CAM attention maps overlaid on input images for interpretability.

Results

0.92 weighted F1 — strong balanced performance across all lesion classes.

Lessons learned

ENS loss and sampling reweighting are complementary: sampling balances what the model sees, ENS loss balances how it learns. Together they substantially outperform either alone.