Skip to content

Add data SSIM metric#19

Merged
treigerm merged 4 commits into
mainfrom
data_ssim
Apr 8, 2025
Merged

Add data SSIM metric#19
treigerm merged 4 commits into
mainfrom
data_ssim

Conversation

@treigerm
Copy link
Copy Markdown
Member

@treigerm treigerm commented Apr 8, 2025

This PR adds the data SSIM metric described in https://ieeexplore.ieee.org/abstract/document/10319365. It is an adaption of the popular SSIM metric often used in compression to floating point data.

This implementation is directly based on the implementation of the authors at https://github.com/NCAR/ldcpy/blob/6c5bcb8149ec7876a4f53b0e784e9c528f6f14cb/ldcpy/calcs.py#L2516.
The official implementation makes assumptions about the input data that are specific to models developed at NCAR which is why we cannot use the official implementation directly.

In this PR I also adjusted the collect_metrics.py script to deal with the fact that we have changed the directory structure to account for having multiple error bounds.

@treigerm treigerm requested a review from juntyr April 8, 2025 12:58
Comment thread src/climatebenchpress/compressor/metrics/dssim.py
Comment thread src/climatebenchpress/compressor/metrics/dssim.py Outdated
Comment thread src/climatebenchpress/compressor/metrics/dssim.py Outdated
@treigerm
Copy link
Copy Markdown
Member Author

treigerm commented Apr 8, 2025

Thank you for the review @juntyr ! I have addressed your comments. I have also opened an issue in the original implementation, asking for a more functional interface (NCAR/ldcpy#358). If they provide a better interface to the code we can then avoid having a custom version for our use case.

@treigerm treigerm merged commit 9dec28b into main Apr 8, 2025
3 checks passed
@treigerm treigerm deleted the data_ssim branch April 8, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants