Figure 1: Overview of our GRMP-IQA framework. (a) Pre-training stage: Meta-Prompt Pre-training Module; (b) Fine-tuning stage: Quality-Aware Gradient Regularization
This repository contains the official open-source code implementation for the paper "Few-Shot Image Quality Assessment via Adaptation of Vision-Language Models" (ICCV 2025).
We propose GRMP-IQA, a few-shot image quality assessment framework based on vision-language model adaptation. Our method achieves superior IQA performance on new datasets using only a small number of labeled samples through meta-learning pre-training and quality-aware gradient regularization.
# Create virtual environment
conda create -n grmp_iqa python=3.8
conda activate grmp_iqa
# Install dependencies
pip install -r requirements.txtICCV_opensource_code/
├── README.md # Project documentation
├── requirements.txt # 🛠️ Environment dependencies
├── pretrain.py # 🔥 Meta-learning pre-training script
├── finetune.py # 🎯 Few-shot fine-tuning script
├── logger.py # Logging utility
├── CLIP/ # 📚 CLIP model related code
│ ├── clip.py # CLIP core implementation
│ ├── model.py # Model architecture definition
│ └── simple_tokenizer.py # Text tokenizer
├── livew_244.mat # 📊 CLIVE dataset
├── Koniq_244.mat # 📊 KonIQ dataset
└── model_checkpoint/ # 💾 Pre-trained model checkpoints
- Download Datasets:
- Data Preprocessing:
# Data has been preprocessed into .mat format, ready to use # livew_244.mat - CLIVE dataset (244x244 resolution) # Koniq_244.mat - KonIQ dataset (244x244 resolution)
- Model Weights and Dataset Available on Hugging Face 🤗
All pre-trained model weights (.pt files) and dataset files (.mat files) are now available on the Hugging Face Model Hub:
Repository: zzhowe/GRMP-IQA
- Model weights: Pre-trained checkpoints (.pt files) for different datasets and configurations
- Dataset files: Processed dataset files (.mat files) including LIVE_224.mat and others
from huggingface_hub import hf_hub_download
import torch
import scipy.io as sio
# Download pre-trained model weights
model_path = hf_hub_download(
repo_id="zzhowe/GRMP-IQA",
filename="clive_50_prompt_lda_5.0.pt"
)
# Download dataset file
dataset_path = hf_hub_download(
repo_id="zzhowe/GRMP-IQA",
filename="LIVE_224.mat"
)
# Load model
model = torch.load(model_path, map_location='cpu')
# Load dataset
dataset = sio.loadmat(dataset_path)# Run meta-learning pre-training (on TID2013 and KADID-10K)
python pretrain.py# 50-shot fine-tuning on CLIVE dataset
python finetune.py --dataset clive --num_image 50 --lda 5.0
# Fine-tuning on KonIQ dataset
python finetune.py --dataset koniq --num_image 50 --lda 5.0
Fine-tuning Parameters ⚙️:
--dataset: Target dataset [clive|koniq|pipal]--num_image: Number of few-shot samples (default: 50)--pretrained: Whether to use a pre-trained image quality assessment model as a regularizer--lda: Gradient regularization weight (default: 5.0)
If our work is helpful for your research, please consider citing:
@article{li2024boosting,
title={Few-Shot Image Quality Assessment via Adaptation of Vision-Language Models},
author={Li, Xudong and Huang, Zihao and Hu, Runze and Zhang, Yan and Cao, Liujuan and Ji, Rongrong},
journal={arXiv preprint arXiv:2409.05381},
year={2024}
}This project is licensed under the MIT License.
For any questions, please feel free to contact us via:
- 📧 Email: [[email protected]] [[email protected]]
- 🐛 Issue: GitHub Issues
⭐ If this project helps you, please give us a Star! ⭐