Skin Lesion Classifier β€” EfficientNet-B2

Trained on HAM10000 balanced dataset. 7 skin lesion classes.

Performance

Metric Value
Overall Accuracy 85.86%
Balanced Accuracy 85.86%
Macro AUC 0.9851
CV Accuracy 5-fold 87.64% Β± 0.46%

Classes

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

API Usage

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

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using kokulan123/skin-lesion-classifier 1