Views
No views yet
(1, 256, 256) axial CT slice, intensity-normalised to [0, 1](1, 256, 256) sigmoid map; foreground = lung tissueunified split (patient-grouped, dataset-stratified)
of a unified corpus assembled from three public sources:| Metric | Value |
|---|---|
| mIoU | 0.9803 |
| Accuracy | 0.9953 |
| Precision | 0.9797 |
| Recall | 0.9857 |
| Dice (F1) | 0.9827 |
1import yaml, torch
2from monai.networks.nets import SegResNet
3
4cfg = yaml.safe_load(open("config.yaml"))["model"]
5model = SegResNet(
6 spatial_dims = cfg["spatial_dims"],
7 in_channels = cfg["in_channels"],
8 out_channels = cfg["out_channels"],
9 init_filters = cfg["init_filters"],
10 blocks_down = tuple(cfg["blocks_down"]),
11 blocks_up = tuple(cfg["blocks_up"]),
12 dropout_prob = cfg["dropout_prob"],
13)
14state = torch.load("model.pth", map_location="cpu", weights_only=True)
15model.load_state_dict(state)
16model.eval()
17
18with torch.no_grad():
19 x = torch.randn(1, 1, 256, 256) # (B, C, H, W) — replace with your CT slice
20 prob = torch.sigmoid(model(x))
21 lung_mask = (prob > 0.5).to(torch.uint8)DiceLoss(sigmoid=True, squared_pred=True)config.yaml.1export DATA_ROOT=/path/to/unified # dir containing ct_2d/ and roi_sem_seg_2d/
2python train.py --config config.yaml