-
Hi. I noticed some unexpected behavior regarding the RandGaussianNoise transform (link to source). The transform has three self-explanatory parameters prob, mean, and std. Based on the docstring, my expectation is that std controls the spread of the Gaussian noise. In other words, if prob=1, mean=0, and std=100, then this transform should always add Gaussian noise with zero mean and a standard deviation of 100 to all image pixels/voxels. However, this expectation isn't met, at least based on my reading of the code implementation. If prob=1, mean=0, and std=100, then this transform adds Gaussian noise with zero mean and a standard deviation randomly selected from 0 to 100. (e.g., it could with a standard deviation of 33). The standard deviation of the noise changes on every call to the transform. Basically, I would expect the Gaussian noise to always have the same, specified standard deviation of std, especially since std is specified as a float and not a tuple (e.g., (0.0, 1.0)). I understand many other random transforms sample parameters (as is being done here with std,) but this behavior still doesn't seem intuitive to me. Does anyone have any insight to why RandGaussianNoise is implemented in this manner? Alternatively, is anyone else surprised by this implementation? Edit: I condensed my question for brevity. It looks like RandRicianNoise (a noise type related to Gaussian noise) has a similar implementation. Except for RandRicianNoise, there is a parameter sample_std which controls whether the standard deviation is sampled from a Uniform distribution or if it's taken as given. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @tim-the-baker, thanks for your interest here. Hope it helps, thanks. |
Beta Was this translation helpful? Give feedback.
Hi @tim-the-baker, thanks for your interest here.
The
RandGaussianNoise
transform in MONAI is designed to introduce randomness into the model's training, aiding in better generalization and preventing overfitting. It works by adding random Gaussian noise to the image data. Rather than having a fixed noise for all augmentations, the transform adds different noise levels sampled from the specified standard deviation each time it's applied. This brings more variation and randomness, and hence robustness, to the training.Hope it helps, thanks.