# MonaiLabel-does training data need to be registered?

**URL:** <https://discourse.slicer.org/t/monailabel-does-training-data-need-to-be-registered/33175>\
**Category:** Support\
**Tags:** segmentation, monailabel\
**Created:** [December 2, 2023, 2:31am UTC](https://discourse.slicer.org/t/monailabel-does-training-data-need-to-be-registered/33175 "2023-12-02T02:31:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nick\_george\_jones](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nick_george_jones/32/68501_2.png) [@nick\_george\_jones](https://discourse.slicer.org/u/nick_george_jones)\
**Post date:** [December 2, 2023, 2:31am UTC](https://discourse.slicer.org/t/monailabel-does-training-data-need-to-be-registered/33175/1 "2023-12-02T02:31:23Z")

</div>

Have set up a label server and starting training. One question I had, as someone relatively new to deep learning based segmentation model development, is if the input images need to be co-registered to some sort of standard? or should the model take care of that? I am using the segmentation.py file.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [December 2, 2023, 3:38am UTC](https://discourse.slicer.org/t/monailabel-does-training-data-need-to-be-registered/33175/2 "2023-12-02T03:38:29Z")

</div>

This is hard to answer without knowing how different the images are from each other. In my experience, the augmentation pipeline in MonaiLabel is quite robust to rotational and translational differences between samples. If your dataset is substantially variable, training may take somewhat longer though…

---

<div class="post-metadata">

**Author:** ![nick\_george\_jones](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nick_george_jones/32/68501_2.png) [@nick\_george\_jones](https://discourse.slicer.org/u/nick_george_jones)\
**Post date:** [December 4, 2023, 9:47pm UTC](https://discourse.slicer.org/t/monailabel-does-training-data-need-to-be-registered/33175/3 "2023-12-04T21:47:29Z")

</div>

Thanks for your input! these are all thin cut temporal bone CT’s so I don’t think there is that much variability but there are certainly some.

---

<div class="post-metadata">

**Author:** ![diazandr3s](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/diazandr3s/32/9973_2.png) [@diazandr3s](https://discourse.slicer.org/u/diazandr3s)\
**Post date:** [December 5, 2023, 11:07am UTC](https://discourse.slicer.org/t/monailabel-does-training-data-need-to-be-registered/33175/4 "2023-12-05T11:07:21Z")

</div>

Hi @nick_george_jones,

Can you please expand on what is the type of dataset you’re using? What do you mean by co-register? Do you have more than one modality per case?

Let us know,

---

<div class="post-metadata">

**Author:** ![nick\_george\_jones](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nick_george_jones/32/68501_2.png) [@nick\_george\_jones](https://discourse.slicer.org/u/nick_george_jones)\
**Post date:** [December 7, 2023, 8:10pm UTC](https://discourse.slicer.org/t/monailabel-does-training-data-need-to-be-registered/33175/5 "2023-12-07T20:10:30Z")

</div>

Hi @diazandr3s ,  
No, it is just a thin-cut temporal bone CT scan. Given variability in patient positioning and such, I thought it might improve accuracy to have them registered to a common atlas image, but in my training so far using deepedit.py it seems unnecessary per muratmaga’s thoughts

One question I do have is that I was wondering if it/s possible to train the model server side only, ie not issuing a request through the Slicer gui? I have access to a linux server with a much larger graphics card, but because of firewall restrictions I can’t access it from my usual machine and would have to run it all there as well as move the images there.

---

<div class="post-metadata">

**Author:** ![diazandr3s](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/diazandr3s/32/9973_2.png) [@diazandr3s](https://discourse.slicer.org/u/diazandr3s)\
**Post date:** [December 11, 2023, 5:00pm UTC](https://discourse.slicer.org/t/monailabel-does-training-data-need-to-be-registered/33175/6 "2023-12-11T17:00:31Z")

</div>

Hi @nick_george_jones,

Thanks for the update.

> One question I do have is that I was wondering if it/s possible to train the model server side only, ie not issuing a request through the Slicer GUI?

Yes, you can run MONAI Label without starting the server. Here I explained how this can be done for batch inference: [Can TotalSegmentator segment maxillofacial CT as well? - #9 by diazandr3s](https://discourse.slicer.org/t/can-totalsegmentator-segment-maxillofacial-ct-as-well/32484/9)

But you can do the same for any task. For training, just change this argument to train: [https://github.com/Project-MONAI/MONAILabel/blob/main/sample-apps/radiology/main.py#L297](https://github.com/Project-MONAI/MONAILabel/blob/main/sample-apps/radiology/main.py#L297)

It just works as a standard Python script.

Hope this helps,

---

<div class="post-metadata">

**Author:** ![nick\_george\_jones](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nick_george_jones/32/68501_2.png) [@nick\_george\_jones](https://discourse.slicer.org/u/nick_george_jones)\
**Post date:** [December 12, 2023, 7:46pm UTC](https://discourse.slicer.org/t/monailabel-does-training-data-need-to-be-registered/33175/7 "2023-12-12T19:46:55Z")

</div>

Yes, thank you very much! I have it working (for now). I really appreciate all the past discussions as well as your help with this question.

I am wondering now, is there away to customize/set certain samples to be train vs validation? or get some insight as to which samples are validation/train in each run?

---

<div class="post-metadata">

**Author:** ![diazandr3s](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/diazandr3s/32/9973_2.png) [@diazandr3s](https://discourse.slicer.org/u/diazandr3s)\
**Post date:** [December 20, 2023, 9:45pm UTC](https://discourse.slicer.org/t/monailabel-does-training-data-need-to-be-registered/33175/8 "2023-12-20T21:45:42Z")

</div>

By default, MONAI Label splits the dataset into 80% for training and 20% for validation.

Here is the method that does this split: [MONAILabel/monailabel/tasks/train/basic\_train.py at main · Project-MONAI/MONAILabel · GitHub](https://github.com/Project-MONAI/MONAILabel/blob/main/monailabel/tasks/train/basic_train.py#L394)

You could overwrite this method and specify a custom validation set instead. As it is done here: [MONAILabel/sample-apps/deepedit\_multilabel/lib/train.py at testsMICCAI · Project-MONAI/MONAILabel · GitHub](https://github.com/Project-MONAI/MONAILabel/blob/testsMICCAI/sample-apps/deepedit_multilabel/lib/train.py#L242)

If using the Segmentation mode, this method should be overwritten in the **lib/trainers/segmentation.py** file

I hope this helps,
