Open MarkusDrange opened 1 year ago
AFAIK, the NeuralNetwork PO has a setMeanAndStandardDeviation
method, but it is not possible to set the mean
and std
values through an Attribute
(see here).
It also looks like the mean
and std
values are floats, and hence it does not support multi-channel input, that is to apply a different mean and std for each channel individually.
Multi-channel values are not supported atm. But if the values are fixed you can just add it as a layer to your model.. so that the first layer in your network performs this normalization on the input image before passing it on to the rest of the layers.
This functionality can be added to the already existing ZeroMeanUnitVariance PO: https://github.com/smistad/FAST/blob/master/source/FAST/Algorithms/IntensityNormalization/ZeroMeanUnitVariance.hpp
This functionality can be added to the already existing ZeroMeanUnitVariance PO: https://github.com/smistad/FAST/blob/master/source/FAST/Algorithms/IntensityNormalization/ZeroMeanUnitVariance.hpp
Yes, I saw this one, but I believe it has the same problem as the NeuralNetwork PO. It is only designed for single-channel images, as per this. Also one would need to add support for setting mean and std, which the NeuralNetwork PO already supports, so wouldn't it make more sense to add it to the NeuralNetwork PO? Or both?
But if the values are fixed you can just add it as a layer to your model.. so that the first layer in your network performs this normalization on the input image before passing it on to the rest of the layers.
This I have done for TF models before. Works wonders.
Have you tried the same in PyTorch, @MarkusDrange? Did it resolve the issue?
Yes! Worked perfectly after adding it to the forward function of my backbone.
This functionality can be added to the already existing ZeroMeanUnitVariance PO: https://github.com/smistad/FAST/blob/master/source/FAST/Algorithms/IntensityNormalization/ZeroMeanUnitVariance.hpp
Yes, I saw this one, but I believe it has the same problem as the NeuralNetwork PO. It is only designed for single-channel images, as per this. Also one would need to add support for setting mean and std, which the NeuralNetwork PO already supports, so wouldn't it make more sense to add it to the NeuralNetwork PO? Or both?
I meant that this functionality can be implemented and added to the ZeroMeanUnitVariance PO.
As a pre-processing step, i do zero mean intensity normalization over all three RGB channels, with the same mean and standard deviation for all patches:
I understand this is not supported in FAST-Pathology pre processing; would it be possible to add this functionality?