NannyML / The-Little-Book-of-ML-Metrics

The book every data scientist needs on their desk.
https://www.nannyml.com/metrics
161 stars 16 forks source link

PSNR - Peak Signal-to-Noise Ratio #91

Open MinhDuy13Ly opened 1 day ago

MinhDuy13Ly commented 1 day ago

Metric's name PSNR - Peak Signal-to-Noise Ratio

Metric's category Computer Vision

Metrics formula

$$ \text{PSNR} = 10 \cdot \log_{10}\left(\frac{MAX^2}{MSE}\right) $$

where

$$ MSE = \frac{1}{h \cdot w} \sum{i=1}^{h} \sum{j=1}^{w} \left( O(i,j) - R(i,j) \right)^2 $$

Describe the metrics use cases, and any relevant references. In the field of image generation and reconstruction, we frequently need to measure how closely our generated images resemble the reference images. Besides modern metrics like FID and Inception Score, PSNR and SSIM are two widely-used classical metrics often used for benchmarking.

The intuition behind PSNR is that it expresses how large the possible signal value (MAX) is in comparison to the error (MSE). If the error is subtle compared to the maximum signal (i.e., a high PSNR), the reconstructed image is relatively similar to the target in terms of pixel values.

Additional context A sample of using PSNR combined with FID for benchmarking could be found in many computer vision papers, such as EdgeConnect: Generative Image Inpainting with Adversarial Edge Learning

Screenshot 2024-10-11 at 17 42 23
santiviquez commented 1 day ago

This is great! Thanks for suggesting it. I'll link it into #69 as metrics to include in the book.

@MinhDuy13Ly Would you like to take the lead on this? I can support you at any step of the PR.

MinhDuy13Ly commented 1 day ago

Sure @santiviquez - I could get help on this and also could help support/review on other metrics in classical ML/computer vision based on my knowledge. Since I have not contribute to any open-source project before and my experience is limited, I would love to receive the feedbacks for further improving.

Do you have any suggestion on the next step?