Image Quality Assessment using Contrastive Learning

Pavan C. Madhusudana, Neil Birkbeck, Yilin Wang, Balu Adsumilli, Alan C. BovikIEEE TIP 2021 · DOI

Abstract

We consider the problem of obtaining image quality representations in a self-supervised manner. We use prediction of distortion type and degree as an auxiliary task to learn features from an unlabeled image dataset containing a mixture of synthetic and realistic distortions. We then train a deep Convolutional Neural Network (CNN) using a contrastive pairwise objective to solve the auxiliary problem. We refer to the proposed training framework and resulting deep IQA model as the CONTRastive Image QUality Evaluator (CONTRIQUE). During evaluation, the CNN weights are frozen and a linear regressor maps the learned representations to quality scores in a No-Reference (NR) setting. We show through extensive experiments that CONTRIQUE achieves competitive performance when compared to state-of-the-art NR image quality models, even without any additional fine-tuning of the CNN backbone. The learned representations are highly robust and generalize well across images afflicted by either synthetic or authentic distortions. Our results suggest that powerful quality representations with perceptual relevance can be obtained without requiring large labeled subjective image quality datasets. The implementations used in this paper are available at https://github.com/pavancm/CONTRIQUE .

Introduction

Predicting how a human perceives image quality without a "perfect" reference image (No-Reference IQA) is a major challenge for social media platforms and camera manufacturers. Traditionally, deep learning models for this task rely on "transfer learning" from ImageNet. However, ImageNet pre-training optimizes for content (e.g., "is this a cat?"), whereas IQA requires sensitivity to distortions (e.g., "is this blurry?").

Furthermore, existing IQA datasets with human subjective scores are small because labeling is labor-intensive, often leading to overfitting when fine-tuning large models. There is also a significant gap between "synthetic" distortions (mathematically applied blur or noise) and "authentic" distortions found in real-world user-generated content (UGC). CONTRIQUE seeks to learn robust quality representations from massive amounts of unlabeled data that generalize across both distortion types.

Methodology

The authors introduce CONTRIQUE (CONTRastive Image QUality Evaluator). The core innovation is the use of self-supervised contrastive learning tailored for quality rather than content.

The CONTRIQUE training framework. It processes both synthetic distortions (top) and authentic distortions from UGC images (bottom) through a shared encoder to optimize a contrastive loss.

The Auxiliary Task

The model is trained to identify the type and degree of distortion. For synthetic data, the "class" is the specific distortion-level pair. For authentic UGC data, the authors use instance discrimination: each image is treated as its own unique class, assuming real-world artifacts are a unique "fingerprint" of that specific capture.

Contrastive Objective and Augmentations

They use a Normalized Temperature-scaled Cross Entropy (NT-Xent) loss to pull representations of the same distortion class together while pushing different ones apart. Unlike standard contrastive learning (like SimCLR), which uses aggressive crops and color jitters to become invariant to those changes, CONTRIQUE uses "quality-preserving" transforms. They use horizontal flips and random color space conversions (RGB, LAB, HSV, grayscale, and Mean-Subtraction). They explicitly avoid Gaussian blur or color jittering during training because those would change the very quality features they want the model to learn.

Experimental Setup

The model was trained on a massive unlabeled corpus of 1.3 million images, including the KADIS dataset for synthetic distortions and AVA, COCO, and others for authentic distortions. For evaluation, a ResNet-50 backbone acts as the encoder. After training, the encoder weights are frozen, and a simple linear (Ridge) regressor is trained on the frozen features to map them to human quality scores from standard benchmarks like KonIQ-10k and LIVE.

Results and Discussion

CONTRIQUE matches or outperforms top-tier supervised models like HyperIQA and DB-CNN across multiple datasets, despite never seeing a human quality score during its primary training phase. On the KonIQ-10k dataset, CONTRIQUE achieved an SROCC (Spearman correlation) of 0.894, outperforming a standard ResNet-50 (0.888) and traditional models like BRISQUE (0.665).

t-SNE visualizations of feature spaces. (a) CONTRIQUE features cluster clearly by distortion type, unlike (b) standard ResNet-50. (c) and (d) demonstrate that CONTRIQUE also discriminates between different levels of the same distortion.

As shown in the t-SNE visualizations, CONTRIQUE's feature space is naturally organized by distortion characteristics. While standard ImageNet-trained models (ResNet-50) fail to separate these distortions effectively, CONTRIQUE shows clear clustering by distortion type and level. This suggests that the learned features are highly aligned with human perception. Furthermore, in cross-dataset tests, CONTRIQUE showed significantly higher robustness than models fine-tuned end-to-end, indicating superior generalization.

Conclusion

CONTRIQUE demonstrates that powerful quality representations with perceptual relevance can be obtained without requiring large labeled subjective image quality datasets. By leveraging contrastive learning on a mixture of synthetic and authentic distortions, the model achieves high robustness and generalization across various IQA benchmarks. Future directions include exploring more complex auxiliary tasks and extending the framework to Video Quality Assessment (VQA).

Summary updated

BibTeX
@article{madhusudana2021image,
  author = {Pavan C. Madhusudana and Neil Birkbeck and Yilin Wang and Balu Adsumilli and Alan C. Bovik},
  title = {{Image Quality Assessment using Contrastive Learning}},
  journal = {IEEE Trans. Image Process.},
  year = {2021},
  doi = {10.1109/tip.2022.3181496},
}
Figure