Closed PedroFerreiradaCosta closed 2 years ago
@danieltudosiu this might be interesting to you too
I second @PedroFerreiradaCosta suggestions. I would just make the following change:
Furthermore, I see a difference between the SSIMLoss and some of the other SSIM implementations.
Lastly, this family of losses has been quite widely used in medical images [1], but it was shown that the basic SSIM is not as well correlated with radiologists' visual assessment as some of its improved versions are [2]. So I would argue that we should try and improve the base implementation and offer more principled defaults for the Loss as well as the Metric. The defaults will differ since some SSIM improvements are non-differentiable as far as I am aware.
cc @mersad95zd @Can-Zhao @finalelement
For context, by extending the pytorch-ssim library we internally have implemented the following (combinations and multi-scale are excluded for clarity):
Besides our implementation, we are missing the more exotic and complex ones:
Furthermore, since MONAI should have de facto defaults, the SSIM class' defaults should be based on medical imaging specific recommendations from publications such as [12][13] and medical imaging tested ones like [1-6,10].
Thanks @PedroFerreiradaCosta @danieltudosiu, these are all very nice suggestions! @wyli I'm a bit busy these days (sorry for my late reply), but will soon collaborate with @Can-Zhao to add these features.
@mersad95zd me and @PedroFerreiradaCosta can work with you on implementing them. Internally we have code that is well documented and is ready to be merged into MONAI core nearly. Would you be ok if we join in on working on this?
thanks @danieltudosiu and @PedroFerreiradaCosta, please go ahead and submit PRs, I think @mersad95zd and @Can-Zhao can help review them...
Another note about the wide applications of SSIM and the requirements for diverse implementations that could be present in MONAI [1]. Furthermore, we should run a window size analysis since the images in medical imaging have different sizes and there were findings indicating that SSIM and its derivatives have different behaviours at different sizes of images [2]. In my opinion, this could easily be explained by the kernel size to image ratio.
https://github.com/Project-MONAI/MONAI/blob/8925e3eea656dd1c24c90db70449c44d8ca0f044/monai/metrics/regression.py#L240 I propose four changes to this class to optimise it with regards to MONAI Core code:
Let me know if this sounds alright and I'm happy to help implementing these changes.