Toolbox of commonly-used image quality assessment algorithms.

ryanxingql, updated πŸ•₯ 2022-03-19 02:46:09

Image Quality Assessment Toolbox

:e-mail: Feel free to contact: [email protected].

0. Archive

  • v3: add MS-SSIM index, BRISQUE and PIQE; re-implement PSNR and SSIM over Python; remove Ma et al. and PI due to the low computation efficiency; remove FID since it is not an image quality evaluator.
  • v2: unify all scripts of algorithms.
  • v1: the first formal version.

1. Content

|metric|class|description|better|range|ref| |:-|:-|:-|:-|:-|:-| |Peak signal-to-noise ratio (PSNR)|FR|The ratio of the maximum pixel intensity to the power of the distortion.|higher|[0, inf)|[WIKI]| |Structural similarity (SSIM) index|FR|Local similarity of luminance, contrast and structure of two image.|higher|(?, 1]|[paper] [WIKI]| |Multi-scale structural similarity (MS-SSIM) index|FR|Based on SSIM; combine luminance information at the highest resolution level with structure and contrast information at several down-sampled resolutions, or scales.|higher|(?, 1]|[paper] [code]| |Learned perceptual image patch similarity (LPIPS)|FR|Obtain L2 distance between AlexNet/SqueezeNet/VGG activations of reference and distorted images; train a predictor to learn the mapping from the distance to similarity score. Trainable.|lower|[0, ?)|[paper] [official repo]| |Blind/referenceless image spatial quality evaluator (BRISQUE)|NR|Model Gaussian distributions of mean subtracted contrast normalized (MSCN) features; obtain 36-dim Gaussian parameters; train an SVM to learn the mapping from feature space to quality score.|lower|[0, ?)|[paper]| |Natural image quality evaluator (NIQE)|NR|Mahalanobis distance between two multi-variate Gaussian models of 36-dim features from natural (training) and input sharp patches.|lower|[0, ?)|[paper]| |Perception based image quality evaluator (PIQE)|NR|Similar to NIQE; block-wise. PIQE is less computationally efficient than NIQE, but it provides local measures of quality in addition to a global quality score.|lower|[0, 100]|[paper]|


  • FR: Full-reference quality metric.
  • NR: No-reference quality metric.


|metric|class|description|better|range|ref|where| |:-|:-|:-|:-|:-|:-|:-| |Ma et al. (MA)|NR|Extract features in DCT, wavelet and PCA domains; train a regression forest to learn the mapping from feature space to quality score. Very slow!|higher|[0, 10]|[paper] [official repo]|[v2]| |perceptual index (PI)|NR|0.5 * ((10 - MA) + NIQE). Very slow due to MA!|lower|[0, ?)|[paper] [official repo]|[v2]| |FrΓ©chet inception distance (FID)|FR|Wasserstein-2 distance between two Gaussian models of InceptionV3 activations (fed with reference and distorted image data-sets, respectively).|lower|[0, ?)|[paper] [cleanfid repo]|[v2]|

Subjective quality metric(s):

|metric|description|better|range|ref| |:-|:-|:-|:-|:-| |mean opinion score (MOS)|Image rating under certain standards.|higher|[0, 100]|[BT.500]| |degradation/difference/differential MOS (DMOS)|Difference between MOS values of reference and distorted images.|lower|[0, 100]|[ref1] [ref2]|

2. Dependency

```bash conda create -n iqa python=3.7 -y && conda activate iqa python -m pip install pyyaml opencv-python tqdm pandas

for psnr/ssim

python -m pip install scikit-image==0.18.2

for ms-ssim/lpips

test under cuda 10.x

python -m pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f

for lpips

python -m pip install lpips==0.1.3 ```

For BRISQUE and NIQE, MATLAB >= R2017b is required; for PIQE, MATLAB >= R2018b is required.

If you want to use to run MATLAB scripts, i.e., call MATLAB in Python, you should install MATLAB package in Conda environment. Check here. My solution:


given linux

cd "matlabroot/extern/engines/python" # e.g., ~/Matlab/R2019b/extern/engines/python conda activate iqa && python install ```

3. Evaluation

  1. Edit opt.yml.
  2. Run: conda activate iqa && [CUDA_VISIBLE_DEVICES=0] python -case div2k_qf10 [-opt opt.yml -clean]. [<args>] are optional.
  3. Output: CSV log files at ./logs/.


  • tar: target, e.g., enhanced compressed images.
  • dst: distorted, e.g., jpeg-compressed images.
  • src: source, e.g., raw/pristine images.
  • The list of the evaluated images is based on tar_dir.

4. License

We adopt Apache License v2.0. For other licenses, please refer to the references.

If you find this repository helpful, you may cite:

tex @misc{2021xing3, author = {Qunliang Xing}, title = {Image Quality Assessment Toolbox}, howpublished = "\url{}", year = {2021}, note = "[Online; accessed 11-April-2021]" }


v1.1.1 2021-04-10 18:52:45

06/14: used also for v2.0.0.

bash cd iqa_pi_niqe_ma/ wget unzip rm

v1.0.0 2021-03-24 13:11:37

For evaluating PI, NIQE (PIRM 18' version) and MA:

  1. Download
  2. Unzip into iqa_pi_niqe_ma/.
  3. Place it in the root of this repository.
Qunliang Xing

Image & Video processing artist

GitHub Repository