Skin Cancer Detection (ConvNeXt-Tiny)
This model is trained on the HAM10000 dataset to classify 7 types of skin lesions. It is intended for research and educational purposes.
π Usage
To use this model, ensure you have torch and torchvision installed.
import torch
import torch.nn as nn
from torchvision.models import convnext_tiny
from huggingface_hub import hf_hub_download
# 1. Re-create the architecture
model = convnext_tiny()
# 2. Adjust the classifier head to match your 7 classes
# ConvNeXt-Tiny's classifier is a Sequence: [LayerNorm, Flatten, Linear]
n_inputs = model.classifier[2].in_features
model.classifier[2] = nn.Linear(n_inputs, 7)
# 3. Download weights from your repo
# Ensure 'filename' matches exactly what you uploaded (e.g., "model.pth" or "weights.pth")
weights_path = hf_hub_download(repo_id="imtiazhumzah/Skin-Cancer-ConvNeXt-Tiny", filename="final_skin_cancer_model.pth")
# 4. Load the weights
model.load_state_dict(torch.load(weights_path, map_location='cpu'))
model.eval()
print("Model loaded successfully!")