File size: 2,763 Bytes
e410f7b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1821564
 
e410f7b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1821564
 
e410f7b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
license: mit
library_name: pytorch
tags:
- medical
- segmentation
- stroke
- neurology
- mri
pipeline_tag: image-segmentation
---

# SynthPseudo

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.

## Model Details

- **Name**: SynthPseudo
- **Classes**: 0 (Background), 1 (Gray Matter), 2 (White Matter), 3 (Gray/White Matter Partial Volume), 4 (Cerebro-Spinal Fluid), 5 (Stroke)
- **Patch Size**: 192³
- **Voxel Spacing**: 1mm³
- **Input Channels**: 1

## Usage

### Loading from Hugging Face Hub

```python
import torch
from synthstroke_model import SynthStrokeModel

# Load the model from Hugging Face Hub
model = SynthStrokeModel.from_pretrained("liamchalcroft/synthstroke-synth-pseudo")

# Prepare your input (example shape: batch_size=1, channels=1, H, W, D)
input_tensor = torch.randn(1, 1, 192, 192, 192)

# Get predictions (with optional TTA for improved accuracy)
predictions = model.predict_segmentation(input_tensor, use_tta=True)

# Get tissue probability maps
background = predictions[:, 0]  # Background
gray_matter = predictions[:, 1]  # Gray Matter
white_matter = predictions[:, 2]  # White Matter
partial_volume = predictions[:, 3]  # Gray/White Matter PV
csf = predictions[:, 4]  # Cerebro-Spinal Fluid
stroke = predictions[:, 5]  # Stroke lesion

# Alternative: Get logits without TTA
logits = model.predict_segmentation(input_tensor, apply_softmax=False)
```

## Citation

[Machine Learning for Biomedical Imaging](https://www.melba-journal.org/papers/2025:014.html)

```bibtex
@article{chalcroft2025synthetic,
  title={Synthetic Data for Robust Stroke Segmentation},
  author={Chalcroft, Liam and Pappas, Ioannis and Price, Cathy J. and Ashburner, John},
  journal={Machine Learning for Biomedical Imaging},
  volume={3},
  pages={317--346},
  year={2025},
  publisher={Machine Learning for Biomedical Imaging},
  doi={10.59275/j.melba.2025-f3g6},
  url={https://www.melba-journal.org/papers/2025:014.html}
}
```

For the original arXiv preprint:

[arXiv](https://arxiv.org/abs/2404.01946)

```bibtex
@article{Chalcroft_2025,
   title={Synthetic Data for Robust Stroke Segmentation},
   volume={3},
   ISSN={2766-905X},
   url={http://dx.doi.org/10.59275/j.melba.2025-f3g6},
   DOI={10.59275/j.melba.2025-f3g6},
   number={August 2025},
   journal={Machine Learning for Biomedical Imaging},
   publisher={Machine Learning for Biomedical Imaging},
   author={Chalcroft, Liam and Pappas, Ioannis and Price, Cathy J. and Ashburner, John},
   year={2025},
   month=aug, pages={317–346} 
}
```

## License

MIT License - see the [LICENSE](https://github.com/liamchalcroft/synthstroke/blob/main/LICENSE) file for details.