Instructions to use kokulan123/skin-lesion-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use kokulan123/skin-lesion-classifier with timm:
import timm model = timm.create_model("hf_hub:kokulan123/skin-lesion-classifier", pretrained=True) - Notebooks
- Google Colab
- Kaggle
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
- -