Downloads · 30 days
0
kokulan123/skin-lesion-classifier
skin-lesion-classifier is a image classification model from kokulan123. Use it when you need a label for an image. It is set up for timm. The card lists the license as mit.
Trained on HAM10000 balanced dataset. 7 skin lesion classes.
Downloads · 30 days
0
Access
Public
Updated Apr 3, 2026
Repo size
31.3 MB
Likes
0
Public
Click a slice to open those files.
.pth31.3 MB · 100%
From the Hugging Face model README
Trained on HAM10000 balanced dataset. 7 skin lesion classes.
| Metric | Value |
|---|---|
| Overall Accuracy | 85.86% |
| Balanced Accuracy | 85.86% |
| Macro AUC | 0.9851 |
| CV Accuracy 5-fold | 87.64% ± 0.46% |
| Code | Full Name |
|---|---|
| akiec | Actinic Keratosis |
| bcc | Basal Cell Carcinoma |
| bkl | Benign Keratosis-like Lesion |
| df | Dermatofibroma |
| mel | Melanoma |
| nv | Melanocytic Nevi |
| vasc | Vascular Lesion |
import requests, base64
with open("skin.jpg", "rb") as f:
encoded = base64.b64encode(f.read()).decode("utf-8")
response = requests.post(
"https://api-inference.huggingface.co/models/YOUR_USERNAME/skin-lesion-classifier",
headers={"Authorization": "Bearer hf_YOUR_TOKEN"},
json={"inputs": encoded}
)
print(response.json())
Research only — not for clinical diagnosis.
---
### Step 4: Download `model.pth` from Google Drive
1. Open **Google Drive** in browser
2. Navigate to `Y2S2/HAM10000_balanced/model_outputs/`
3. Right-click `best_model_final.pth` → **Download**
4. Rename the downloaded file to `model.pth`
5. Move it into your `skin-lesion-hf` folder
Your folder should now look like this:
skin-lesion-hf/ ├── model.pth ← downloaded from Drive ├── config.json ← created above ├── labels.json ← created above ├── handler.py ← created above └── README.md ← created above
---
### Step 5: Upload Files to Hugging Face
1. Go to your repo page: `huggingface.co/YOUR_USERNAME/skin-lesion-classifier`
2. Click **"Files"** tab
3. Click **"Add file"** → **"Upload files"**
4. Drag and drop all 5 files at once
5. Scroll down → commit message: `Add model files`
6. Click **"Commit changes to main"**
> `model.pth` is large (~37MB) — wait for the upload bar to complete fully before committing.
---
### Step 6: Get Your API URL
Once uploaded your API URL is simply:
https://api-inference.huggingface.co/models/YOUR_USERNAME/skin-lesion-classifier
That's it. No extra setup needed.
---
### Step 7: Add to Your Render Backend
In Render dashboard → your backend service → **Environment** tab, add:
HF_TOKEN = hf_YOUR_TOKEN_HERE HF_MODEL_URL = https://api-inference.huggingface.co/models/YOUR_USERNAME/skin-lesion-classifier