Brain CT ICH Ensemble

λ‡Œ CT λ‘κ°œλ‚΄μΆœν˜ˆ(ICH) 6클래슀 λΆ„λ₯˜ μ•™μƒλΈ”μž…λ‹ˆλ‹€.
EfficientNet-B4 + ConvNeXt-Small + ResNet18 ν™•λ₯  평균을 μ‚¬μš©ν•©λ‹ˆλ‹€.

연ꡬ/ꡐ윑용이며 μž„μƒ μ§„λ‹¨μš©μ΄ μ•„λ‹™λ‹ˆλ‹€.

Classes

id name ν•œκΈ€
0 epidural κ²½λ§‰μ™ΈμΆœν˜ˆ
1 intraparenchymal λ‡Œμ‹€μ§ˆλ‚΄μΆœν˜ˆ
2 intraventricular λ‡Œμ‹€λ‚΄μΆœν˜ˆ
3 subarachnoid μ§€μ£Όλ§‰ν•˜μΆœν˜ˆ
4 subdural κ²½λ§‰ν•˜μΆœν˜ˆ
5 any λ‘κ°œλ‚΄μΆœν˜ˆ

Files

  • tf_efficientnet_b4_ns_jft_in1k_fold0.pt
  • convnext_small_fb_in22k_ft_in1k_fold0.pt
  • ich_resnet18.pt

μ²΄ν¬ν¬μΈνŠΈλŠ” model_state_dict (λ˜λŠ” ResNet18의 model) ν‚€λ₯Ό ν¬ν•¨ν•œ torch.save dictμž…λ‹ˆλ‹€.

Usage

from pathlib import Path
import torch
import timm
from huggingface_hub import hf_hub_download

REPO = "kimsungil/brain-ich-ensemble"
NUM_CLASSES = 6

def load_ckpt(filename, model_name, device):
    path = hf_hub_download(REPO, filename)
    blob = torch.load(path, map_location=device, weights_only=False)
    sd = blob.get("model_state_dict") or blob.get("model") or blob
    kwargs = dict(pretrained=False, num_classes=NUM_CLASSES)
    if "resnet" not in model_name.lower():
        kwargs.update(drop_rate=0.2, drop_path_rate=0.1)
    model = timm.create_model(model_name, **kwargs)
    model.load_state_dict(sd, strict=False)
    return model.to(device).eval()

device = torch.device("cpu")
models = [
    load_ckpt("tf_efficientnet_b4_ns_jft_in1k_fold0.pt", "tf_efficientnet_b4.ns_jft_in1k", device),
    load_ckpt("convnext_small_fb_in22k_ft_in1k_fold0.pt", "convnext_small.fb_in22k_ft_in1k", device),
    load_ckpt("ich_resnet18.pt", "resnet18", device),
]

μž…λ ₯ μ΄λ―Έμ§€λŠ” ν•™μŠ΅κ³Ό 같이 380Γ—380, brain/subdural μœˆλ„μš°λ₯Ό μ‚¬μš©ν•˜μ„Έμš”.

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