sct-pipeline / contrast-agnostic-softseg-spinalcord

Contrast-agnostic spinal cord segmentation project with softseg
MIT License
4 stars 3 forks source link

Configs for super-duper single and per-contrast models #17

Closed uzaymacar closed 2 years ago

uzaymacar commented 2 years ago

This PR adds 4 config files for training super-duper methods, which refers to using a single label for all contrasts that is sampled in the native space of the image:

All config files in this PR use the spine-generic-processed dataset (version: 4d60963478566a472897114d0c53c01cb327c48f) and the labels_softseg derivative folder.

uzaymacar commented 2 years ago

The first problem detected with the config files is that the center crop, length, and stride parameters are not suitable for the spine-generic-processed dataset. Therefore, below is a quick exploration of the resolutions and sizes of the image data across the three contrasts T1w, T2*, and T2w.

T1w

RESOLUTIONS:  Counter({(1.0, 1.0, 1.0): 254})                                                                                                                                    
SIZES:  Counter({(192, 260, 320): 169, (192, 320, 320): 49, (188, 320, 320): 33, (190, 260, 320): 1, (192, 170, 320): 1, (192, 254, 313): 1})   

T2*

RESOLUTIONS:  Counter({(0.5, 0.5, 5.0): 243, (0.4, 0.4, 5.0): 8, (0.5, 0.5, 7.0): 1, (0.5, 0.5, 6.0): 1, (0.5, 0.5, 6.5): 1})
SIZES:  Counter({(448, 448, 15): 195, (320, 320, 15): 44, (512, 512, 15): 8, (448, 448, 24): 7})

T2w

RESOLUTIONS:  Counter({(0.8, 0.8, 0.8): 254})
SIZES:  Counter({(64, 320, 320): 172, (63, 320, 320): 49, (56, 320, 320): 33})
uzaymacar commented 2 years ago

Latest commit e8aef0a introduces the following training hyperparameter updates across all configs:

To briefly justify the last point, we are inputting the whole volume during both training and inference to the model at each pass similar to how we did with SC segmentation in model_seg_ms_mp2rage project. The value (224, 256, 320) was chosen by resampling all volumes across all contrasts to 1x1x1 mm^3 resolution and getting the maximum size across each dimension x, y, and z. This value shouldn't create a problem in inference in terms of RAM overflow as discussed in model_seg_ms_mp2rage/issues/29.

This is probably not the most efficient nor ideal solution. However it is chosen initially as the ideas we have discussed in the last meeting (e.g., variable center-crop and cascaded architecture; see meeting minutes) will take longer to implement as it requires modifications to ivadomed codebase. I will be working on the required modifications in parallel while we get baselines with the described approach.