• Stars
    star
    141
  • Rank 259,971 (Top 6 %)
  • Language
    C++
  • License
    BSD 3-Clause "New...
  • Created over 2 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SSIMULACRA 2. Perceptual metric.

SSIMULACRA 2 - Structural SIMilarity Unveiling Local And Compression Related Artifacts

Perceptual metric developed by Jon Sneyers (Cloudinary) in July-October 2022, updated in April 2023.

Usage

ssimulacra2 original.png distorted.png

Returns a score in range -inf..100, which correlates to subjective visual quality scores as follows:

  • 30 = low quality. This corresponds to the p10 worst output of mozjpeg -quality 30.
  • 50 = medium quality. This corresponds to the average output of cjxl -q 40 or mozjpeg -quality 40, or the p10 output of cjxl -q 50 or mozjpeg -quality 60.
  • 70 = high quality. This corresponds to the average output of cjxl -q 65 or mozjpeg -quality 70, p10 output of cjxl -q 75 or mozjpeg -quality 80.
  • 90 = very high quality. Likely impossible to distinguish from the original when viewed at 1:1 from a normal viewing distance. This corresponds to the average output of mozjpeg -quality 95 or the p10 output of cjxl -q 95.

How it works

SSIMULACRA 2 is based on the concept of the multi-scale structural similarity index measure (MS-SSIM), computed in a perceptually relevant color space, adding two other (asymmetric) error maps, and aggregating using two different norms.

  • XYB color space (rescaled to a 0..1 range and with B-Y)
  • Three error maps:
    • SSIM map (with a corrected SSIM formula that avoids applying gamma correction twice)
    • 'blockiness/ringing' map (error means distorted has edges where original is smooth)
    • 'smoothing/blur' map (error means distorted is smooth where original has edges)
  • Each of these error maps is computed at 6 scales (1:1 to 1:32) for each component (X,Y,B)
  • Downscaling is done in linear color (i.e. the perceptually correct way)
  • For each of these 6*3*3=54 maps, two norms are computed: 1-norm (mean) and 4-norm
  • A weighted sum of these 54*2=108 norms leads to the final score
  • Weights were tuned based on a large set of subjective scores (CID22, TID2013, Kadid10k, KonFiG-IQA), including images compressed with JPEG, JPEG 2000, JPEG XL, WebP, AVIF, HEIC, and various artificial distortions.

Final results after tuning:

SSIMULACRA 2.1:

Dataset KRCC SRCC PCC
CID22 0.6903 0.8805 0.8583
TID2013 0.6590 0.8445 0.8471
KADID-10k 0.6175 0.8133 0.8030
KonFiG(F) 0.7668 0.9194 0.9136

SSIMULACRA 2.0:

Dataset KRCC SRCC PCC
CID22 0.6934 0.8820 0.8601
TID2013 0.6322 0.8194 0.8103
KADID-10k 0.5870 0.7851 0.7018
KonFiG(F) 0.7813 0.9280 0.8710

The weight tuning was done by running Nelder-Mead simplex search, optimizing to minimize MSE and to maximize Kendall and Pearson correlation for training data consisting of the CID22 training data, TID2013, KADID-10k and KonFiG (F boosting).

Changes compared to SSIMULACRA 2.0:

  • weights retuned to correlate better with other datasets
  • changed the range of the 3 components to ensure they are in 0..1 so the SSIM formula makes sense
  • added a polynomial remapping of the error score to allow a better fit to datasets with higher distortions

Changes compared to the original version (SSIMULACRA 1):

  • works in XYB color space instead of CIE Lab
  • linear downscaling
  • fixed SSIM formula
  • uses 1-norm and 4-norm (instead of 1-norm and max-norm-after-downscaling)
  • penalizes both smoothing and ringing artifacts (instead of only penalizing ringing but not smoothing)
  • removed specific grid-like blockiness detection
  • tuned using a much larger set of subjective opinions (and using absolute quality scores, not just relative comparison results)

Metric performance

These tables show the correlation of various metrics in terms of Kendall Rank Correlation Coefficient (KRCC), Spearman Rank Correlation Coefficient (SRCC), and Pearson Correlation Coefficient (PCC), for various IQA datasets.

TID2013:

Metric KRCC SRCC PCC
PSNR-Y 0.4699 0.6394 0.428
PSNR-HVS 0.5464 0.698 0.6846
SSIM 0.5707 0.7552 0.764
MS-SSIM 0.6068 0.7868 0.7802
VMAF 0.5608 0.7439 0.7728
SSIMULACRA 2 0.6322 0.8194 0.8103
SSIMULACRA 2.1 0.659 0.8445 0.8471
DSSIM -0.6984 -0.871 -0.8021
Butteraugli (3-norm) -0.4935 -0.6639 -0.4878
PSNR (ImageMagick) 0.4958 0.6869 0.6601

KADID-10k:

Metric KRCC SRCC PCC
PSNR-Y 0.4555 0.6319 0.5932
PSNR-HVS 0.4229 0.5927 0.5949
SSIM 0.5889 0.7806 0.6576
MS-SSIM 0.6466 0.8359 0.6836
VMAF 0.5343 0.7253 0.7185
SSIMULACRA 2 0.587 0.7851 0.7018
SSIMULACRA 2.1 0.6175 0.8133 0.803
DSSIM -0.6679 -0.8561 -0.6544
Butteraugli (3-norm) -0.3846 -0.543 -0.4424
PSNR (ImageMagick) 0.4876 0.6757 0.6214

KonFiG-IQA: (Experiment I, F boosting, clamping negative JND (better than reference) to zero)

Metric KRCC SRCC PCC
PSNR-Y 0.5871 0.7598 0.6968
PSNR-HVS 0.7798 0.9277 0.8453
SSIM 0.6156 0.7795 0.7052
MS-SSIM 0.6635 0.8299 0.6834
VMAF 0.3866 0.4906 0.463
SSIMULACRA 2 0.7813 0.928 0.871
SSIMULACRA 2.1 0.7668 0.9194 0.9136
DSSIM -0.7595 -0.9147 -0.673
Butteraugli (3-norm) -0.771 -0.9238 -0.7587
PSNR (ImageMagick) 0.6531 0.8248 0.7218

CID22 full set: (22k subjective scores)

Metric KRCC SRCC PCC
PSNR-Y 0.4452 0.6246 0.5901
PSNR-HVS 0.6076 0.81 0.7559
SSIM 0.5628 0.7577 0.7005
MS-SSIM 0.5596 0.7551 0.7035
VMAF 0.6176 0.8163 0.7799
SSIMULACRA 2 0.6934 0.882 0.8601
SSIMULACRA 2.1 0.6903 0.8805 0.8583
DSSIM -0.6428 -0.8399 -0.7813
Butteraugli 3-norm -0.6547 -0.8387 -0.7903
PSNR (ImageMagick) 0.3472 0.5002 0.4817

CID22 validation set: (4292 subjective scores, not used for tuning)

Metric KRCC SRCC PCC
PSNR-Y 0.4734 0.6577 0.6354
PSNR-HVS 0.6199 0.8224 0.7848
SSIM 0.6028 0.7871 0.7647
MS-SSIM 0.5915 0.7781 0.7601
VMAF 0.588 0.7884 0.7502
SSIMULACRA 2 0.7033 0.8854 0.8745
SSIMULACRA 2.1 0.7077 0.8904 0.8787
DSSIM -0.6807 -0.8722 -0.822
Butteraugli 3-norm -0.6102 -0.7938 -0.745
PSNR (ImageMagick) 0.3491 0.4995 0.5013

Building

Building instructions for Debian:

sudo apt install build-essential git libhwy-dev liblcms2-dev libjpeg62-turbo-dev libpng-dev cmake ninja-build
mkdir build
cd build
cmake ../src -G Ninja
ninja ssimulacra2

or simply execute build_ssimulacra2. Other distributions should be similar; you may need to use libjpeg-turbo8-dev instead of libjpeg62-turbo-dev. Version 2.13 of lcms2 is needed.

The source code of SSIMULACRA 2 is also part of the tools of libjxl.

The bash script build_ssimulacra2_from_libjxl_repo can be used to fetch the code and compile only what is needed for SSIMULACRA 2.

More Repositories

1

cloudinary_npm

Cloudinary NPM for node.js integration
JavaScript
623
star
2

cloudinary-react

React components that utilize Cloudinary functionality
JavaScript
500
star
3

responsive_breakpoints_generator

JavaScript
437
star
4

cloudinary_gem

Cloudinary GEM for Ruby on Rails integration
Ruby
420
star
5

cloudinary_php

PHP extension for Cloudinary
PHP
380
star
6

cloudinary_js

Cloudinary JavaScript library
CSS
328
star
7

cloudinary_angular

Cloudinary Angular client library
TypeScript
305
star
8

pycloudinary

Python package for cloudinary
Python
249
star
9

cloudinary_ios

Cloudinary iOS SDK
Swift
164
star
10

fuif

Free Universal Image Format
C++
163
star
11

cloudinary_java

Cloudinary Java Client Library
Java
160
star
12

cloudinary-vue

Cloudinary components library for Vue.js application, for image and video optimization.
JavaScript
99
star
13

CloudinaryDotNet

Cloudinary DotNet library
C#
98
star
14

ssimulacra

C++
93
star
15

cloudinary-video-player

Cloudinary Video Player
JavaScript
70
star
16

cloudinary_android

Android client for integrating with Cloudinary
Java
66
star
17

pkg-cloudinary-core

Distribution repository for the Cloudinary JavaScript library. Cloudinary is an end-to-end solution for all your image and video needs.
JavaScript
54
star
18

js-url-gen

Cloudinary's base javascript library, including URL generation.
HTML
47
star
19

frontend-frameworks

Cloudinary javascript frontend frameworks SDKs, including Shared HTML layer, Angular, React and Vue SDKs
TypeScript
41
star
20

cloudinary_wordpress

Cloudinary's WordPress plugin
PHP
39
star
21

cloudinary-go

Cloudinary Golang package
Go
36
star
22

cloudinary_android_parse_sample

Sample Android photo album app with Cloudinary using Parse as backend
Java
24
star
23

cloudinary_parse

Cloudinary Parse Module for easy integration
JavaScript
22
star
24

cloudinary_pubnub_demo

Demo for uploading images to Cloudinary and sharing them in real-time using PubNub
JavaScript
18
star
25

cloudinary-cli

A command line interface for Cloudinary's APIs
Python
17
star
26

cloudinary-svelte

Cloudinary components library for Svelte
JavaScript
17
star
27

cloudinary_scala

Cloudinary Scala Client Library
Scala
16
star
28

cloudinary_magento

Cloudinary's Magento extension. Upload product images to the cloud, manipulate them to match your graphic design and optimize images for better user experience
PHP
16
star
29

wdio-allure-ts

WebdriverIO, Allure reporter and TypeScript wrapper for UI E2E testing
TypeScript
15
star
30

cloudinary_magento2

Cloudinary's Magento 2 extension. Upload product images to the cloud, manipulate them to match your graphic design and optimize images for better user experience
PHP
15
star
31

pkg-cloudinary-jquery

Distribution repository for the Cloudinary JavaScript library and jQuery Plugin. Cloudinary is an end-to-end solution for all your image and video needs.
JavaScript
11
star
32

cloudinary_kotlin

Cloudinary Kotlin SDK library
Kotlin
10
star
33

cloudinary_sap_commerce

Cloudinary's SAP Commerce Extension
Java
9
star
34

android-demo

Java
9
star
35

cloudinary-react-native

TypeScript
9
star
36

pkg-cloudinary-jquery-file-upload

Distribution repository for the Cloudinary jQuery File Upload library. Cloudinary is an end-to-end solution for all your image and video needs.
JavaScript
9
star
37

web-speed-test-server

Page Speed Image Performance Analysis (Server)
JavaScript
8
star
38

web-speed-test-client

Page Speed Image Performance Analysis
JavaScript
8
star
39

cloudinary_sfcc_pagedesigner

Cloudinary Salesforce PageDesigner Integration
JavaScript
8
star
40

cloudinary_dart

Dart
7
star
41

bower-cloudinary

Cloudinary JavaScript bower package
JavaScript
6
star
42

cloudinary-js-streaming

Cloudinary Live Streaming Javascript SDK
JavaScript
6
star
43

cloudinary_flutter

Dart
6
star
44

cloudinary_tinymce

TinyMCE plugin for adding and manipulating images from Cloudinary's cloud-based media library
JavaScript
5
star
45

php-transformation-builder-sdk

Cloudinary PHP Transformation Builder SDK
PHP
3
star
46

mailinary

scrape and email web pages on schedule or on demand
JavaScript
3
star
47

cloudinary_titanium

Cloudinary integration library for Appcelerator Titanium
JavaScript
3
star
48

cloudinary_sfcc_site_cartridge

Salesforce Commerce Cloud integration
JavaScript
3
star
49

cloudinary-video-analytics

JavaScript
2
star
50

cloudinary-ios-sample-app

Cloudinary iOS sample application
Swift
2
star
51

product-customization-sample-app

JavaScript
2
star
52

imagemagick_blog

Complementary source code to Cloudinary's ImageMagick blog post
Ruby
2
star
53

cloudinary_chrome_extension

Cloudinary's Chrome extension for web developers
2
star
54

cloudinary_cake_php

Cloudinary CakePHP module
PHP
2
star
55

js-transformation-builder-sdk

TypeScript
2
star
56

media-management-js

JavaScript
2
star
57

vue-cli-plugin-cloudinary

Plugin of Cloudinary Vue SDK for Vue CLI
JavaScript
2
star
58

media-editing-js

JavaScript
1
star
59

cloudinaryNodeMongo

Upload images to Cloudinary and display previously uploaded images in a grid
JavaScript
1
star
60

cloudinary-live-demo

JavaScript
1
star
61

cloudinary_commercetools

Cloudinary demo for Commercetools
TypeScript
1
star
62

live-streaming-demo

Demo of live video streaming using video streaming sdk
JavaScript
1
star
63

account-provisioning-php

Cloudinary Account Provisioning PHP SDK
PHP
1
star
64

media-editing-api-php

Cloudinary Media Editing API PHP SDK
PHP
1
star
65

media-editing-java

1
star