liamchalcroft commited on
Commit
e410f7b
·
verified ·
1 Parent(s): 89c7c64

Upload SynthStroke synth_pseudo model

Browse files
Files changed (2) hide show
  1. README.md +90 -0
  2. model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: pytorch
4
+ tags:
5
+ - medical
6
+ - segmentation
7
+ - stroke
8
+ - neurology
9
+ - mri
10
+ pipeline_tag: image-segmentation
11
+ ---
12
+
13
+ # SynthPseudo
14
+
15
+ Synthseg-style model trained on synthetic data derived from OASIS3 tissue maps and ATLAS binary lesion masks. Augmented with pseudo-labels from a private T1w dataset.
16
+
17
+ ## Model Details
18
+
19
+ - **Name**: SynthPseudo
20
+ - **Classes**: 0 (Background), 1 (Gray Matter), 2 (White Matter), 3 (Gray/White Matter Partial Volume), 4 (Cerebro-Spinal Fluid), 5 (Stroke)
21
+ - **Patch Size**: 192³
22
+ - **Voxel Spacing**: 1mm³
23
+ - **Input Channels**: 1
24
+
25
+ ## Usage
26
+
27
+ ### Loading from Hugging Face Hub
28
+
29
+ ```python
30
+ import torch
31
+ from synthstroke_model import SynthStrokeModel
32
+
33
+ # Load the model from Hugging Face Hub
34
+ model = SynthStrokeModel.from_pretrained("liamchalcroft/synthstroke-synth-pseudo")
35
+
36
+ # Prepare your input (example shape: batch_size=1, channels=1, H, W, D)
37
+ input_tensor = torch.randn(1, 1, 192, 192, 192)
38
+
39
+ # Get predictions (with optional TTA for improved accuracy)
40
+ predictions = model.predict_segmentation(input_tensor, use_tta=True)
41
+
42
+ # Get tissue probability maps
43
+ background = predictions[:, 0] # Background
44
+ gray_matter = predictions[:, 1] # Gray Matter
45
+ white_matter = predictions[:, 2] # White Matter
46
+ partial_volume = predictions[:, 3] # Gray/White Matter PV
47
+ csf = predictions[:, 4] # Cerebro-Spinal Fluid
48
+ stroke = predictions[:, 5] # Stroke lesion
49
+
50
+ # Alternative: Get logits without TTA
51
+ logits = model.predict_segmentation(input_tensor, apply_softmax=False)
52
+ ```
53
+
54
+ ## Citation
55
+
56
+ ```bibtex
57
+ @article{chalcroft2025synthetic,
58
+ title={Synthetic Data for Robust Stroke Segmentation},
59
+ author={Chalcroft, Liam and Pappas, Ioannis and Price, Cathy J. and Ashburner, John},
60
+ journal={Machine Learning for Biomedical Imaging},
61
+ volume={3},
62
+ pages={317--346},
63
+ year={2025},
64
+ publisher={Machine Learning for Biomedical Imaging},
65
+ doi={10.59275/j.melba.2025-f3g6},
66
+ url={https://www.melba-journal.org/papers/2025:014.html}
67
+ }
68
+ ```
69
+
70
+ For the original arXiv preprint:
71
+
72
+ ```bibtex
73
+ @article{Chalcroft_2025,
74
+ title={Synthetic Data for Robust Stroke Segmentation},
75
+ volume={3},
76
+ ISSN={2766-905X},
77
+ url={http://dx.doi.org/10.59275/j.melba.2025-f3g6},
78
+ DOI={10.59275/j.melba.2025-f3g6},
79
+ number={August 2025},
80
+ journal={Machine Learning for Biomedical Imaging},
81
+ publisher={Machine Learning for Biomedical Imaging},
82
+ author={Chalcroft, Liam and Pappas, Ioannis and Price, Cathy J. and Ashburner, John},
83
+ year={2025},
84
+ month=aug, pages={317–346}
85
+ }
86
+ ```
87
+
88
+ ## License
89
+
90
+ MIT License - see the [LICENSE](https://github.com/liamchalcroft/synthstroke/blob/main/LICENSE) file for details.
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea482afb1754326e4f1ee257f3e833ee2b7ce899dd083cd28233e47b3c345e04
3
+ size 74499236