Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend benchmarks with computation of scores for NR and DB metrics #270

Merged
merged 56 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7b268a0
add evaluation on NR and DB metrics
snk4tr Sep 5, 2021
e246e3b
Merge branch 'master' into feature/extend_bench
zakajd Sep 6, 2021
c7973cb
Merge branch 'master' into feature/extend_bench
snk4tr Oct 12, 2021
71528ec
fix flake8 style
snk4tr Oct 12, 2021
2e74265
Merge branch 'master' into feature/extend_bench
snk4tr Oct 16, 2021
8c3a05c
add GS and PR metrics to the evaluation
snk4tr Oct 16, 2021
9f2452b
Merge branch 'master' into feature/extend_bench
snk4tr Nov 19, 2021
6e72e4f
Merge branch 'master' into feature/extend_bench
snk4tr Feb 4, 2022
424f03b
the currest state of things
snk4tr Feb 4, 2022
caff5e2
Merge branch 'master' into feature/extend_bench
snk4tr Feb 10, 2022
df2fbbf
updates to compute DB metrics with different feature extractors
snk4tr Feb 14, 2022
543dd70
Merge branch 'master' into feature/extend_bench
snk4tr Feb 14, 2022
b439ed2
address style check errors
snk4tr Feb 14, 2022
a3a1765
fix PieAPP initialization
snk4tr Feb 20, 2022
600cb4e
add values of correlations on TID2013 and KADID-10k
snk4tr Feb 20, 2022
4aa0030
try to round values of correlations to the second digit
snk4tr Feb 20, 2022
414f44f
fix the two-digit formatting
snk4tr Feb 20, 2022
537549f
add normalization for computation o features with InceptionNet, remov…
snk4tr Feb 20, 2022
ca94c10
update values of DB metrics on PIPAL dataset
snk4tr Mar 25, 2022
94c5270
fix the table formatting
snk4tr Mar 25, 2022
a5f7c56
Merge branch 'master' into feature/extend_bench
snk4tr Mar 25, 2022
0a52486
fix metrics initialization
snk4tr Mar 25, 2022
9da0984
Merge remote-tracking branch 'origin/feature/extend_bench' into featu…
snk4tr Mar 25, 2022
c8d6424
Merge branch 'master' into feature/extend_bench
snk4tr Mar 25, 2022
39b4ed7
add description of how DB metrics are computed
snk4tr Mar 25, 2022
a6cd558
fix reference
snk4tr Mar 25, 2022
bb654aa
fix reference
snk4tr Mar 25, 2022
c3a02a7
fix reference
snk4tr Mar 25, 2022
266cc36
fix reference
snk4tr Mar 25, 2022
891a2a5
fix reference
snk4tr Mar 25, 2022
3552ab6
fix reference
snk4tr Mar 25, 2022
7900f0c
fix reference
snk4tr Mar 25, 2022
a633c2e
fix reference
snk4tr Mar 25, 2022
147f0fc
remove cross-reference after miserable failed attempt to include it
snk4tr Mar 25, 2022
d034e9e
Fix spelling of Jamil's name
snk4tr Mar 25, 2022
561e4ca
Update tests/results_benchmark.py
snk4tr Mar 26, 2022
6d7827b
address review comments
snk4tr Mar 26, 2022
dc036b2
add iw-ssim to the benchmark
snk4tr Mar 26, 2022
0e93688
allow to compute all metrics of all metrics from a particular category
snk4tr Mar 26, 2022
29b4ebe
fix cli, clean up debug prints
snk4tr Mar 26, 2022
5e0d95a
clean up debug info
snk4tr Mar 26, 2022
af6c7ac
fix data range for mdsi init
snk4tr Mar 26, 2022
80462bf
all direct link to the `results_benchmark.py` script
snk4tr Mar 27, 2022
e69b671
edit readme
snk4tr Apr 17, 2022
740a040
edit readme - simplify the reference
snk4tr Apr 17, 2022
f4f2729
reduce the table of correlations
snk4tr Apr 17, 2022
467ceb3
fix the table
snk4tr Apr 17, 2022
41fface
fix the table
snk4tr Apr 17, 2022
b1c9cdf
fix the table values (reference)
snk4tr Apr 17, 2022
8455dc0
readme: fix title underline length for readthedocs
snk4tr Apr 17, 2022
da4987f
incorporate requested changes
snk4tr Apr 17, 2022
6fbfc70
remove code duplication (code smell)
snk4tr Apr 18, 2022
b648714
Merge branch 'master' into feature/extend_bench
snk4tr Apr 18, 2022
c884d37
feat: minor change in doc
denproc Apr 18, 2022
4223d90
Merge branch 'master' into feature/extend_bench
snk4tr Apr 19, 2022
797502a
comparisons with reference values for IW-SSIM and BRISQUE
snk4tr Apr 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 56 additions & 42 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ The full documentation is available at https://piq.readthedocs.io.
Usage Examples
---------------

Image-based metrics
Image-Based metrics
^^^^^^^^^^^^^^^^^^^
The group of metrics (such as PSNR, SSIM, BRISQUE) takes image or images as input.
The group of metrics (such as PSNR, SSIM, BRISQUE) takes an image or a pair of images as input to compute a distance between them.
We have a functional interface, which returns a metric value, and a class interface, which allows to use any metric
as a loss function.

Expand All @@ -116,10 +116,10 @@ as a loss function.

For a full list of examples, see `image metrics <https://github.com/photosynthesis-team/piq/blob/master/examples/image_metrics.py>`_ examples.

Feature-based metrics
^^^^^^^^^^^^^^^^^^^^^
Distribution-Based metrics
^^^^^^^^^^^^^^^^^^^^^^^^^^

The group of metrics (such as IS, FID, KID) takes a list of image features.
The group of metrics (such as IS, FID, KID) takes a list of image features to compute the distance between distributions.
Image features can be extracted by some feature extractor network separately or by using the ``compute_feats`` method of a
class.

Expand Down Expand Up @@ -161,8 +161,8 @@ For a full list of examples, see `feature metrics <https://github.com/photosynth
List of metrics
---------------

Full Reference
^^^^^^^^^^^^^^
Full-Reference (FR)
^^^^^^^^^^^^^^^^^^^

=========== ====== ==========
Acronym Year Metric
Expand All @@ -187,8 +187,8 @@ PieAPP 2018 `Perceptual Image-Error Assessment through Pairwise Prefere
DISTS 2020 `Deep Image Structure and Texture Similarity <https://arxiv.org/abs/2004.07728>`_
=========== ====== ==========

No Reference
^^^^^^^^^^^^
No-Reference (NR)
^^^^^^^^^^^^^^^^^

=========== ====== ==========
Acronym Year Metric
Expand All @@ -197,8 +197,8 @@ TV 1937 `Total Variation <https://en.wikipedia.org/wiki/Total_varia
BRISQUE 2012 `Blind/Referenceless Image Spatial Quality Evaluator <https://ieeexplore.ieee.org/document/6272356>`_
=========== ====== ==========

Feature based
^^^^^^^^^^^^^
Distribution-Based (DB)
^^^^^^^^^^^^^^^^^^^^^^^

=========== ====== ==========
Acronym Year Metric
Expand All @@ -218,7 +218,7 @@ PR 2019 `Improved Precision and Recall <https://arxiv.org/abs/1904.
Benchmark
---------

As part of our library we provide code to benchmark all metrics on a set of common Mean Opinon Scores databases.
As part of our library we provide `code to benchmark <tests/results_benchmark.py>`_ all metrics on a set of common Mean Opinon Scores databases.
Currently we support `TID2013`_, `KADID10k`_ and `PIPAL`_.
You need to download them separately and provide path to images as an argument to the script.

Expand All @@ -228,40 +228,48 @@ Here is an example how to evaluate SSIM and MS-SSIM metrics on TID2013 dataset:

python3 tests/results_benchmark.py --dataset tid2013 --metrics SSIM MS-SSIM --path ~/datasets/tid2013 --batch_size 16

We report `Spearman's Rank Correlation cCoefficient <https://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient>`_ (SRCC)
and `Kendall rank correlation coefficient <https://en.wikipedia.org/wiki/Kendall_rank_correlation_coefficient>`_ (KRCC).
Below we provide a comparison between `Spearman's Rank Correlation cCoefficient <https://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient>`_ (SRCC) values obtained with PIQ and reported in surveys.
Closer SRCC values indicate the higher degree of agreement between results of computations on given datasets.
We do not report `Kendall rank correlation coefficient <https://en.wikipedia.org/wiki/Kendall_rank_correlation_coefficient>`_ (KRCC)
as it is highly correlated with SRCC and provides limited additional information.
We do not report `Pearson linear correlation coefficient <https://en.wikipedia.org/wiki/Pearson_correlation_coefficient>`_ (PLCC)
as it's highly dependent on fitting method and is biased towards simple examples.

For metrics that can take greyscale or colour images, ``c`` means chromatic version.

=========== ================= ================================ ================= ================================ ================= ================================
\ TID2013 KADID10k PIPAL
----------- --------------------------------------------------- --------------------------------------------------- ---------------------------------------------------
Acronym SRCC / KRCC (PIQ) SRCC / KRCC SRCC / KRCC (PIQ) SRCC / KRCC SRCC / KRCC (PIQ) SRCC / KRCC
=========== ================= ================================ ================= ================================ ================= ================================
PSNR 0.687 / 0.496 0.687 / 0.496 `TID2013`_ 0.676 / 0.488 \- / - 0.407 / 0.276 0.407 / 0.277 `PIPAL`_
SSIM 0.720 / 0.527 0.637 / 0.464 `TID2013`_ 0.724 / 0.537 0.718 / 0.532 `KADID10k`_ 0.498 / 0.345 0.529 / 0.369 `PIPAL`_
MS-SSIM 0.798 / 0.597 0.787 / 0.608 `TID2013`_ 0.802 / 0.609 0.802 / 0.609 `KADID10k`_ 0.552 / 0.389 0.462 / -
IW-SSIM 0.778 / 0.598 0.778 / 0.598 `IW-SSIM`_ 0.850 / 0.666 0.850 / 0.666 `KADID10k`_ 0.595 / 0.427 \- / -
VIFp 0.610 / 0.458 0.610 / 0.457 `TID2013`_ 0.650 / 0.477 0.650 / 0.477 `KADID10k`_ 0.497 / 0.345 \- / -
FSIM 0.802 / 0.629 0.801 / 0.630 `TID2013`_ 0.830 / 0.639 0.829 / 0.639 `KADID10k`_ 0.588 / 0.415 0.596 / 0.421 `PIPAL`_
FSIMc 0.851 / 0.667 0.851 / 0.667 `TID2013`_ 0.854 / 0.665 0.854 / 0.665 `KADID10k`_ 0.590 / 0.416 \- / -
SR-SIM 0.807 / 0.641 0.808 / 0.641 `Eval2019`_ 0.839 / 0.652 0.839 / 0.652 `KADID10k`_ 0.565 / 0.399 \- / -
SR-SIMc 0.870 / 0.692 \- / - 0.869 / 0.685 \- / - 0.569 / 0.401 \- / -
GMSD 0.804 / 0.633 0.803 / 0.635 `MS-GMSD`_ 0.847 / 0.664 0.847 / 0.664 `KADID10k`_ 0.584 / 0.414 \- / -
VSI 0.895 / 0.716 0.897 / 0.718 `Eval2019`_ 0.878 / 0.690 0.861 / 0.678 `KADID10k`_ 0.539 / 0.375 \- / -
DSS 0.791 / 0.614 0.792 / - `Eval2019`_ 0.860 / 0.674 0.860 / 0.674 `KADID10k`_ 0.632 / 0.456 \- / -
Content 0.705 / 0.517 \- / - 0.724 / 0.533 \- / - 0.450 / 0.307 \- / -
Style 0.538 / 0.372 \- / - 0.647 / 0.465 \- / - 0.343 / 0.231 \- / -
HaarPSI 0.873 / 0.692 0.873 / 0.692 `HaarPSI`_ 0.885 / 0.700 0.885 / 0.699 `KADID10k`_ 0.589 / 0.417 \- / -
MDSI 0.890 / 0.712 0.890 / 0.712 `MDSI`_ 0.885 / 0.702 0.885 / 0.702 `KADID10k`_ 0.585 / 0.408 \- / -
MS-GMSD 0.812 / 0.646 0.814 / 0.647 `MS-GMSD`_ 0.852 / 0.669 \- / - 0.585 / 0.414 \- / -
MS-GMSDc 0.888 / 0.711 0.687 / 0.496 `MS-GMSD`_ 0.870 / 0.683 \- / - 0.587 / 0.416 \- / -
LPIPS-VGG 0.670 / 0.497 0.670 / 0.497 `DISTS`_ 0.720 / 0.531 \- / - 0.573 / 0.404 0.577 / 0.408 `PIPAL`_
PieAPP 0.836 / 0.650 0.875 / 0.710 `DISTS`_ 0.866 / 0.676 \- / - 0.698 / 0.509 0.711 / 0.521 `PIPAL`_
DISTS 0.805 / 0.613 0.830 / 0.639 `DISTS`_ 0.875 / 0.695 \- / - 0.617 / 0.438 0.664 / 0.477 `PIPAL`_
=========== ================= ================================ ================= ================================ ================= ================================
=========== =========================== =========================== ===========================
\ TID2013 KADID10k PIPAL
----------- --------------------------- --------------------------- ---------------------------
Source PIQ / Reference PIQ / Reference PIQ / Reference
=========== =========================== =========================== ===========================
PSNR 0.69 / 0.69 `TID2013`_ 0.68 / - 0.41 / 0.41 `PIPAL`_
SSIM 0.72 / 0.64 `TID2013`_ 0.72 / 0.72 `KADID10k`_ 0.50 / 0.53 `PIPAL`_
MS-SSIM 0.80 / 0.79 `TID2013`_ 0.80 / 0.80 `KADID10k`_ 0.55 / 0.46 `PIPAL`_
IW-SSIM 0.78 / 0.78 `Eval2019`_ 0.85 / 0.85 `KADID10k`_ 0.60 / -
VIFp 0.61 / 0.61 `TID2013`_ 0.65 / 0.65 `KADID10k`_ 0.50 / -
FSIM 0.80 / 0.80 `TID2013`_ 0.83 / 0.83 `KADID10k`_ 0.59 / 0.60 `PIPAL`_
FSIMc 0.85 / 0.85 `TID2013`_ 0.85 / 0.85 `KADID10k`_ 0.59 / -
SR-SIM 0.81 / 0.81 `Eval2019`_ 0.84 / 0.84 `KADID10k`_ 0.57 / -
SR-SIMc 0.87 / - 0.87 / - 0.57 / -
GMSD 0.80 / 0.80 `MS-GMSD`_ 0.85 / 0.85 `KADID10k`_ 0.58 / -
VSI 0.90 / 0.90 `Eval2019`_ 0.88 / 0.86 `KADID10k`_ 0.54 / -
DSS 0.79 / 0.79 `Eval2019`_ 0.86 / 0.86 `KADID10k`_ 0.63 / -
Content 0.71 / - 0.72 / - 0.45 / -
Style 0.54 / - 0.65 / - 0.34 / -
HaarPSI 0.87 / 0.87 `HaarPSI`_ 0.89 / 0.89 `KADID10k`_ 0.59 / -
MDSI 0.89 / 0.89 `MDSI`_ 0.89 / 0.89 `KADID10k`_ 0.59 / -
MS-GMSD 0.81 / 0.81 `MS-GMSD`_ 0.85 / - 0.59 / -
MS-GMSDc 0.89 / 0.89 `MS-GMSD`_ 0.87 / - 0.59 / -
LPIPS-VGG 0.67 / 0.67 `DISTS`_ 0.72 / - 0.57 / 0.58 `PIPAL`_
PieAPP 0.84 / 0.88 `DISTS`_ 0.87 / - 0.70 / 0.71 `PIPAL`_
DISTS 0.81 / 0.83 `DISTS`_ 0.88 / - 0.62 / 0.66 `PIPAL`_
BRISQUE 0.37 / 0.84 `Eval2019`_ 0.33 / 0.53 `KADID10k`_ 0.21 / -
IS 0.26 / - 0.25 / - 0.09 / -
FID 0.67 / - 0.66 / - 0.18 / -
KID 0.42 / - 0.66 / - 0.12 / -
MSID 0.21 / - 0.32 / - 0.01 / -
GS 0.37 / - 0.37 / - 0.02 / -
=========== =========================== =========================== ===========================

.. _TID2013: http://www.ponomarenko.info/tid2013.htm
.. _KADID10k: http://database.mmsp-kn.de/kadid-10k-database.html
Expand All @@ -273,6 +281,12 @@ DISTS 0.805 / 0.613 0.830 / 0.639 `DISTS`_ 0.875 / 0.695
.. _PIPAL: https://arxiv.org/pdf/2011.15002.pdf
.. _IW-SSIM: https://ieeexplore.ieee.org/document/7442122

Unlike FR and NR IQMs, designed to compute an image-wise distance, the DB metrics compare distributions of *sets* of images.
To address these problems, we adopt a different way of computing the DB IQMs proposed in `<https://arxiv.org/abs/2203.07809>`_.
Instead of extracting features from the whole images, we crop them into overlapping tiles of size ``96 × 96`` with ``stride = 32``.
This pre-processing allows us to treat each pair of images as a pair of distributions of tiles, enabling further comparison.
The other stages of computing the DB IQMs are kept intact.

.. benchmark-section-end

.. assertions-section-start
Expand Down Expand Up @@ -322,7 +336,7 @@ Contacts

**Sergey Kastryulin** - `@snk4tr <https://github.com/snk4tr>`_ - ``[email protected]``

**Djamil Zakirov** - `@zakajd <https://github.com/zakajd>`_ - ``[email protected]``
**Jamil Zakirov** - `@zakajd <https://github.com/zakajd>`_ - ``[email protected]``

**Denis Prokopenko** - `@denproc <https://github.com/denproc>`_ - ``[email protected]``

Expand Down
Loading