Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
license: apache-2.0
|
5 |
+
library_name: atommic
|
6 |
+
datasets:
|
7 |
+
- SKMTEA
|
8 |
+
thumbnail: null
|
9 |
+
tags:
|
10 |
+
- image-segmentation
|
11 |
+
- AttentionUNet
|
12 |
+
- ATOMMIC
|
13 |
+
- pytorch
|
14 |
+
model-index:
|
15 |
+
- name: SEG_AttentionUNet_SKMTEA
|
16 |
+
results: []
|
17 |
+
|
18 |
+
---
|
19 |
+
|
20 |
+
|
21 |
+
## Model Overview
|
22 |
+
|
23 |
+
AttentionUNet for MRI Segmentation on the SKMTEA dataset.
|
24 |
+
|
25 |
+
|
26 |
+
## ATOMMIC: Training
|
27 |
+
|
28 |
+
To train, fine-tune, or test the model you will need to install [ATOMMIC](https://github.com/wdika/atommic). We recommend you install it after you've installed latest Pytorch version.
|
29 |
+
```
|
30 |
+
pip install atommic['all']
|
31 |
+
```
|
32 |
+
|
33 |
+
## How to Use this Model
|
34 |
+
|
35 |
+
The model is available for use in ATOMMIC, and can be used as a pre-trained checkpoint for inference or for fine-tuning on another dataset.
|
36 |
+
|
37 |
+
Corresponding configuration YAML files can be found [here](https://github.com/wdika/atommic/tree/main/projects/SEG/SKMTEA/conf).
|
38 |
+
|
39 |
+
### Automatically instantiate the model
|
40 |
+
|
41 |
+
```base
|
42 |
+
pretrained: true
|
43 |
+
checkpoint: https://huggingface.co/wdika/SEG_AttentionUNet_SKMTEA/blob/main/SEG_AttentionUNet_SKMTEA.atommic
|
44 |
+
mode: test
|
45 |
+
```
|
46 |
+
|
47 |
+
### Usage
|
48 |
+
|
49 |
+
You need to download the SKM-TEA dataset to effectively use this model. Check the [SKMTEA](https://github.com/wdika/atommic/blob/main/projects/SEG/SKMTEA/README.md) page for more information.
|
50 |
+
|
51 |
+
|
52 |
+
## Model Architecture
|
53 |
+
```base
|
54 |
+
model:
|
55 |
+
model_name: SEGMENTATIONATTENTIONUNET
|
56 |
+
segmentation_module: AttentionUNet
|
57 |
+
segmentation_module_input_channels: 1
|
58 |
+
segmentation_module_output_channels: 4
|
59 |
+
segmentation_module_channels: 32
|
60 |
+
segmentation_module_pooling_layers: 5
|
61 |
+
segmentation_module_dropout: 0.0
|
62 |
+
segmentation_module_normalize: false
|
63 |
+
segmentation_loss:
|
64 |
+
dice: 1.0
|
65 |
+
dice_loss_include_background: true # always set to true if the background is removed
|
66 |
+
dice_loss_to_onehot_y: false
|
67 |
+
dice_loss_sigmoid: false
|
68 |
+
dice_loss_softmax: false
|
69 |
+
dice_loss_other_act: none
|
70 |
+
dice_loss_squared_pred: false
|
71 |
+
dice_loss_jaccard: false
|
72 |
+
dice_loss_flatten: false
|
73 |
+
dice_loss_reduction: mean_batch
|
74 |
+
dice_loss_smooth_nr: 1e-5
|
75 |
+
dice_loss_smooth_dr: 1e-5
|
76 |
+
dice_loss_batch: true
|
77 |
+
dice_metric_include_background: true # always set to true if the background is removed
|
78 |
+
dice_metric_to_onehot_y: false
|
79 |
+
dice_metric_sigmoid: false
|
80 |
+
dice_metric_softmax: false
|
81 |
+
dice_metric_other_act: none
|
82 |
+
dice_metric_squared_pred: false
|
83 |
+
dice_metric_jaccard: false
|
84 |
+
dice_metric_flatten: false
|
85 |
+
dice_metric_reduction: mean_batch
|
86 |
+
dice_metric_smooth_nr: 1e-5
|
87 |
+
dice_metric_smooth_dr: 1e-5
|
88 |
+
dice_metric_batch: true
|
89 |
+
segmentation_classes_thresholds: [0.5, 0.5, 0.5, 0.5]
|
90 |
+
segmentation_activation: sigmoid
|
91 |
+
magnitude_input: true
|
92 |
+
log_multiple_modalities: false # log all modalities in the same image, e.g. T1, T2, T1ce, FLAIR will be concatenated
|
93 |
+
normalization_type: minmax
|
94 |
+
normalize_segmentation_output: true
|
95 |
+
complex_data: false
|
96 |
+
```
|
97 |
+
|
98 |
+
## Training
|
99 |
+
```base
|
100 |
+
optim:
|
101 |
+
name: adam
|
102 |
+
lr: 1e-4
|
103 |
+
betas:
|
104 |
+
- 0.9
|
105 |
+
- 0.98
|
106 |
+
weight_decay: 0.0
|
107 |
+
sched:
|
108 |
+
name: InverseSquareRootAnnealing
|
109 |
+
min_lr: 0.0
|
110 |
+
last_epoch: -1
|
111 |
+
warmup_ratio: 0.1
|
112 |
+
|
113 |
+
trainer:
|
114 |
+
strategy: ddp_find_unused_parameters_false
|
115 |
+
accelerator: gpu
|
116 |
+
devices: 1
|
117 |
+
num_nodes: 1
|
118 |
+
max_epochs: 20
|
119 |
+
precision: 16-mixed # '16-mixed', 'bf16-mixed', '32-true', '64-true', '64', '32', '16', 'bf16'
|
120 |
+
enable_checkpointing: false
|
121 |
+
logger: false
|
122 |
+
log_every_n_steps: 50
|
123 |
+
check_val_every_n_epoch: -1
|
124 |
+
max_steps: -1
|
125 |
+
```
|
126 |
+
|
127 |
+
## Performance
|
128 |
+
|
129 |
+
Evaluation can be performed using the segmentation [evaluation](https://github.com/wdika/atommic/blob/main/tools/evaluation/segmentation.py) script for the segmentation task, with --evaluation_type per_slice.
|
130 |
+
|
131 |
+
Results
|
132 |
+
-------
|
133 |
+
|
134 |
+
Evaluation
|
135 |
+
----------
|
136 |
+
DICE = 0.909 +/- 0.08848 F1 = 0.6371 +/- 0.4746 HD95 = 6.358 +/- 2.209 IOU = 0.5294 +/- 0.3607
|
137 |
+
|
138 |
+
|
139 |
+
## References
|
140 |
+
|
141 |
+
[1] [ATOMMIC](https://github.com/wdika/atommic)
|
142 |
+
|
143 |
+
[2] Desai AD, Schmidt AM, Rubin EB, et al. SKM-TEA: A Dataset for Accelerated MRI Reconstruction with Dense Image Labels for Quantitative Clinical Evaluation. 2022
|