Stroke classifier (EfficientNet-B0)
Distilled EfficientNet-B0 for binary No-Stroke / Stroke logits on head CT–style RGB images.
Not for clinical use — research / demo only.
Files
| File | Role |
|---|---|
model.pth |
PyTorch state dict (canonical keys) |
load_model.py |
Architecture + load_model(repo_id) |
model_config.json |
Input size and class indices |
Input: RGB, 299×299, ImageNet normalization.
Install
pip install torch torchvision pillow huggingface_hub
Load (minimal)
from huggingface_hub import hf_hub_download
import torch
from load_model import build_model # save ``load_model.py`` from this repo next to your script
path = hf_hub_download(repo_id="melisklc0/efficientnet-b0-stroke-distilled", filename="model.pth", repo_type="model")
model = build_model()
model.load_state_dict(torch.load(path, map_location="cpu"))
model.eval()
Or download weights automatically:
from load_model import load_model, predict_proba
from PIL import Image
m, tfm = load_model("melisklc0/efficientnet-b0-stroke-distilled")
print(predict_proba(m, tfm, Image.open("image.png")))