Skip to content

LXDxmu/GRMP-IQA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌟 [ICCV 2025] Few-Shot Image Quality Assessment via Adaptation of Vision-Language Models

image

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

GitHub stars arXiv Python PyTorch CLIP Hugging Face

📖 Introduction

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.

🛠️ Environment Setup

# Create virtual environment
conda create -n grmp_iqa python=3.8
conda activate grmp_iqa

# Install dependencies
pip install -r requirements.txt

📁 Project Structure

ICCV_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

🚀 Quick Start

Step 1: Data Preparation 📊

  1. Download Datasets:
  1. 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)
  2. Model Weights and Dataset Available on Hugging Face 🤗

Step 2:📥 Download Resources

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

Available Files

  • 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

Quick Download Examples

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)

Step 3: Meta-Learning Pre-training 🎓

# Run meta-learning pre-training (on TID2013 and KADID-10K)
python pretrain.py

Step 4: Few-Shot Fine-tuning 🎯

# 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)

📚 Citation

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}
}

📄 License

This project is licensed under the MIT License.

📞 Contact

For any questions, please feel free to contact us via:


⭐ If this project helps you, please give us a Star! ⭐

About

[ICCV 2025] Few-Shot Image Quality Assessment via Adaptation of Vision-Language Models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages