Version-dependent RandomMotion behavior #901
Replies: 6 comments 1 reply
-
Hi, @mariakawula. Can you try setting the PyTorch seed before calling the transform with both versions? import torch
torch.manual_seed(1234) |
Beta Was this translation helpful? Give feedback.
-
with the same seeding in the two version you should find the same deformation I am not surprise to see those kind of different severity for similar motion range, this is due to when motion changes occur in time. you can find the information with the times parameter in the history of the transformed subject If motion occur at the beginning or at the end it well only perturbs high frequency of the image, whereas if it happen in the middle of the experiment you may induce large contrast change or object doubling |
Beta Was this translation helpful? Give feedback.
-
I set the manual seed as you both suggested and did reproduce deformations within one version. There is still the inter-version difference though. I'm still trying to get to the history and find this 'time' parameter. I will let you know how it goes. Do you have other ideas on what can cause it? The newer version slows down the convergence during training and the model achieves only sub-optimal performance. Of course, I can come back to 0.18.46 but this bothers me and makes me wonder whether there were some changes done to the source code of torchio |
Beta Was this translation helpful? Give feedback.
-
Thanks you for investigating, it is important to report if there are changes between both version (I do not see why ...). tmot = RandomMotion(include=['image', 'label'], p=1, degrees=(0, 10), translation=(0, 30))
suj_tranform = tmot(suj)
suj_transform.history |
Beta Was this translation helpful? Give feedback.
-
It's slightly more convoluted since I'm using Compose transforms and DataLoaders but the core is the same:
I'm using a combination of monai, torch, and tochio funcions. Everything runs inside a monai 0.6.0 container. In the meantime I'm uninstalling one torchio version and installing the other one |
Beta Was this translation helpful? Give feedback.
-
See #911. I introduced this bug in |
Beta Was this translation helpful? Give feedback.
-
Hi all,
using the latest torchio (0.18.78) I'm getting very strong and unrealistic deformation if compared to 0.18.46.
I'm running the same snippet with the two aforementioned versions and getting totally different results:
RandomMotion(include=['image', 'label'], p=1, degrees=(0, 10), translation=(0, 30))
I tested it multiple times so I'm certain, it's not due to the random character of the deformation:
left 0.18.46 vs. right 0.18.78
Were there any changes related to RandomMotion? Cannot find any note on that.
The older version gives very nice artifacts that I can imagine occur due to 3 cm patient motion. The one on the right is way too much.
Beta Was this translation helpful? Give feedback.
All reactions