liamchalcroft commited on
Commit
4fe49be
·
verified ·
1 Parent(s): be69224

Upload SynthStroke qsynth model

Browse files
Files changed (2) hide show
  1. README.md +70 -0
  2. model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # qSynth
14
+
15
+ Synthseg-style model trained on qMRI-constrained synthetic data derived from OASIS3 tissue maps and ATLAS binary lesion masks.
16
+
17
+ ## Model Details
18
+
19
+ - **Name**: qSynth
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-qsynth")
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
+ @misc{chalcroft2025domainagnosticstrokelesionsegmentation,
58
+ title={Domain-Agnostic Stroke Lesion Segmentation Using Physics-Constrained Synthetic Data},
59
+ author={Liam Chalcroft and Jenny Crinion and Cathy J. Price and John Ashburner},
60
+ year={2025},
61
+ eprint={2412.03318},
62
+ archivePrefix={arXiv},
63
+ primaryClass={eess.IV},
64
+ url={https://arxiv.org/abs/2412.03318},
65
+ }
66
+ ```
67
+
68
+ ## License
69
+
70
+ 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:75f0d894382d9d0b9830cf7cce282ea5047cfe2de2ec017ea13c71942fdc2afd
3
+ size 74499236