|
class SSIMMetric(RegressionMetric): |
I propose four changes to this class to optimise it with regards to MONAI Core code:
- Have the option to return the contrast sensitivity metric, presented in the original paper: Wang, Z., Bovik, A.C., Sheikh, H.R. and Simoncelli, E.P., 2004.
Image quality assessment: from error visibility to structural similarity.
IEEE transactions on image processing, 13(4), pp.600-612. -> Sec 3.B - Eq 9
This value is needed to calculate the MS SSIM.
- Return not only a value, but the metric across batches and channels:
Not calling .mean() below
|
loss: torch.Tensor = 1 - ssim_value.mean() |
- Have the metric not depend on the Loss, optimally it could be the other way around as the Loss is itself implementing the metric. This way the loss can call the metric and return the .mean() of the metric.
|
ssim_value: torch.Tensor = 1 - SSIMLoss(self.win_size, self.k1, self.k2, self.spatial_dims)( |
- This is secondary, but it would be great to aim to have both an object and a functional implementation of the metric as it happens with other metrics in MONAI Core.
Let me know if this sounds alright and I'm happy to help implementing these changes.
MONAI/monai/metrics/regression.py
Line 240 in 8925e3e
I propose four changes to this class to optimise it with regards to MONAI Core code:
Image quality assessment: from error visibility to structural similarity.
IEEE transactions on image processing, 13(4), pp.600-612. -> Sec 3.B - Eq 9
This value is needed to calculate the MS SSIM.
Not calling .mean() below
MONAI/monai/losses/ssim_loss.py
Line 124 in 8925e3e
MONAI/monai/metrics/regression.py
Line 295 in 8925e3e
Let me know if this sounds alright and I'm happy to help implementing these changes.