Views
No views yet
| File | Task | Architecture | Test result |
|---|---|---|---|
unet_stenosis.pt | Direct stenosis detection (primary model) | U-Net, base=32 | F1 0.645 · recall 95.7% · image-level sensitivity 95.7% |
unet_vessel.pt | Vessel segmentation (explanation layer) | U-Net, base=32 | Dice 0.702 (val 0.768) |
unet.py (in this repo).report/Stenoz_Ilmiy_Maqola.pdf), sections 4–5.unet_vessel.pt was trained on the syntax split (vessel
segmentation), unet_stenosis.pt on the stenosis split (lesion
localization).1import torch
2from huggingface_hub import hf_hub_download
3
4# unet.py must be downloaded from this repo (or from
5# https://github.com/uzbtrust/stenoz/blob/main/src/unet.py) and importable
6from unet import UNet
7
8weights = hf_hub_download("uzbtrust/stenoz-coronary-stenosis-unet", "unet_stenosis.pt")
9ckpt = torch.load(weights, map_location="cpu")
10model = UNet(base=ckpt.get("base", 32))
11model.load_state_dict(ckpt["state"])
12model.eval()
13
14# img: float32 numpy array normalized to [0,1], H and W padded to a multiple of 16
15with torch.no_grad():
16 prob = torch.sigmoid(model(img_tensor)) # [1,1,H,W] — per-pixel stenosis probabilitysrc/dlstenosis.py
and src/dlseg.py.unet_stenosis.pt don't overlap a ground-truth annotation (precision ≈
48.6%); recall (95.7%) was deliberately prioritized via pos_weight=10.