Ir para o conteúdo
ModelListadosExterno
Baixar

Qwen2.5 VL KvasirVQA X1 Ft

Fine-tuned vision–language models for Visual Question Answering (VQA) in gastrointestinal (GI) endoscopy, trained on the Kvasir-VQA-x1 benchmark.

TipoLoRAModelo baseQwen/Qwen2.5-7B-InstructVersãoadapter_modelBnota

Fonte do modelo

Tipo
LoRA
Tamanho do arquivo
77,1 MB
Modelo base
Qwen/Qwen2.5-7B-Instruct
Versão
vadapter_model
Atualizado
23 de out. de 2026
Downloads
25
Fonte
Hugging Face

Descrição da fonte

🧠 Model Card for Kvasir-VQA-x1 Fine-Tuned Models

Fine-tuned vision–language models for Visual Question Answering (VQA) in gastrointestinal (GI) endoscopy, trained on the Kvasir-VQA-x1 benchmark.

🧩 Overview

These models extend strong multimodal backbones (Qwen2.5-VL, Qwen2.5-VL-Transf., and MedGemma) using parameter-efficient LoRA fine-tuning on clinically validated image–question–answer pairs from Kvasir-VQA-x1.
They are designed to generate concise, clinically accurate responses to natural-language questions about endoscopic findings, instruments, and anatomical landmarks.

🔗 Key Resources

📊 Model Summary

ModelBase ModelHugging FaceTraining Logs (W&B)
Qwen2.5-VL-KvasirVQA-x1-ftQwen2.5-VL-7B-Instruct🔗 SimulaMet/Qwen2.5-VL-KvasirVQA-x1-ftW&B Run 7mk4gz8s
Qwen2.5-VL-Transf-KvasirVQA-x1-ftQwen2.5-VL-7B-Transf.🔗 SimulaMet/Qwen2.5-VL-Transf-KvasirVQA-x1-ftW&B Run megwnbz6
MedGemma-KvasirVQA-x1-ftMedGemma-4B-IT🔗 SimulaMet/MedGemma-KvasirVQA-x1-ftW&B Run 7mk4gz8s

⚙️ Training Configuration

AttributeSpecification
GPUs4–8 × A100 (80 GB)
Precisionbfloat16 (DeepSpeed ZeRO-2)
FrameworksTransformers + Swift + PEFT
OptimizerFused AdamW
SchedulerLinear / Cosine (model-specific)
Effective Batch Size36 (MedGemma) / 32 (Qwen)

🧪 Evaluation Highlights

ModelParamsEpochsLRLoRA (r/α)TimeEval Acc.Eval Loss
MedGemma-Transf.4.3 B42e-516 / 6427 h84.97 %0.4111
Qwen2.5-VL-Transf.8.3 B42e-516 / 6430.9 h85.91 %0.3883
Qwen2.5-VL8.3 B32e-516 / 6423 h85.78 %0.3906

(Evaluation on 1 % held-out subset of training data.)

🧮 Evaluation Protocol

Traditional n-gram metrics (BLEU, ROUGE) fail to capture clinical correctness, so these models are evaluated using an LLM-based structured adjudicator (Qwen/Qwen3-30B-A3B). Each model prediction is graded per clinical aspect (polyp_type, instrument_presence, etc.) with binary scores and textual justifications:

{
  "eval_json": {
    "polyp_type": {"score": 1, "reason": "Model correctly identified a sessile polyp."},
    "instrument_presence": {"score": 0, "reason": "Failed to mention visible biopsy forceps."}
  }
}

This yields fine-grained, reproducible category-wise accuracy metrics reflecting true clinical reasoning performance. See details in the paper.

🖼️ Usage Example

!pip install ms-swift==3.8.0 bitsandbytes qwen_vl_utils==0.0.11

import torch
from swift.llm import PtEngine, RequestConfig, InferRequest
from transformers import BitsAndBytesConfig

bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_use_double_quant=True,
    bnb_4bit_compute_dtype=torch.float16
)

engine = PtEngine(
    adapters=["SimulaMet/Qwen2.5-VL-KvasirVQA-x1-ft"],  # or use other fine-tuned model IDs
    model_id_or_path="Qwen/Qwen2.5-VL-7B-Instruct",  # or use other base model IDs
    quantization_config=bnb_config,
    attn_impl="sdpa",
    use_hf=True,
)

req_cfg = RequestConfig(max_tokens=512, temperature=0.3, top_k=20, top_p=0.7, repetition_penalty=1.05)

infer_requests = [
    InferRequest(messages=[{
        "role": "user",
        "content": [
            {"type": "image", "image": "https://huggingface.co/datasets/SimulaMet/Kvasir-VQA-x1/resolve/main/images/clb0kvxvm90y4074yf50vf5nq.jpg"},
            {"type": "text", "text": "What is shown in the image?"}
        ],
    }])
]

resp = engine.infer(infer_requests, req_cfg)
print(resp[0].choices[0].message.content)

👉 See detailed examples in the Colab usage notebook.

📄 License

See base model-specific LICENSEs.

📢 Citation

If you use these models or the dataset, please cite:

@incollection{Gautam2025Oct,
  author    = {Gautam, Sushant and Riegler, Michael and Halvorsen, P{\aa}l},
  title     = {{Kvasir-VQA-x1:A Multimodal Dataset for Medical Reasoning and Robust MedVQA in Gastrointestinal Endoscopy}},
  booktitle = {{Data Engineering in Medical Imaging}},
  journal   = {SpringerLink},
  pages     = {53--63},
  year      = {2025},
  month     = oct,
  isbn      = {978-3-032-08009-7},
  publisher = {Springer},
  address   = {Cham, Switzerland},
  doi       = {10.1007/978-3-032-08009-7_6}
}

Fontes

1 fonte
Hugging FacePrimárioVersão 79e77755aaabd8e665d306d77499c0335400371b
huggingface.co/SimulaMet/Qwen2.5-VL-KvasirVQA-x1-ft/tree/79e77755aaabd8e665d306d77499c0335400371b

Verificado 23 de out.

Artefatos de modelo

1 artefato

adapter_model.safetensors

safetensors · 77,1 MB · SHA-256 7343d61a9b40…81ab · Hugging Face

Download file

Trechos de fonte

3 trechos

--- base_model: Qwen/Qwen2.5-7B-Instruct library_name: peft language: - en tags: - vision - vqa - medical - endoscopy - kvasir - fine-tuning - qwen - visual-question-answering license: mit pipeline_tag: visual-question-answering datasets: - SimulaMet/Kvasir-VQA-x1 training: framework: peft method: lora base_model: Qwen/Qwen2.5-7B-Instruct precision: bfloat16 dataset: SimulaMet/Kvasir-VQA-x1 tasks: - visual-question-answering metrics: - accuracy - bleu - rouge --- # 🧠 Model Card for Kvasir-VQA-x1 Fine-Tuned Models Fine-tuned vision–language models for **Visual Question Answering (VQA)** in **gastrointestinal (GI) endoscopy**, trained on the [Kvasir-VQA-x1](https://huggingface.co/datasets/SimulaMet/Kvasir-VQA-x1) benchmark. ## 🧩 Overview These models extend strong multimodal backbones (**Qwen2.5-VL**, **Qwen2.5-VL-Transf.**, and **MedGemma**) using **parameter-efficient LoRA fine-tuning** on clinically validated image–question–answer pairs from **Kvasir-VQA-x1**. They are designed to generate **concise, clinically accurate** responses to natural-language questions about endoscopic findings, instruments, and anatomical landmarks. ## 🔗 Key Resources - **Dataset:** [SimulaMet/Kvasir-VQA-x1](https://huggingface.co/datasets/SimulaMet/Kvasir-VQA-x1) - **ArXiv:** [arXiv:2506.09958](https://arxiv.org/abs/2506.09958) - **GitHub:** [Simula/Kvasir-VQA-x1](https://github.com/Simula/Kvasir-VQA-x1) - **Colab Demo:** [Usage Notebook ▶️](https://colab.research.google.com/github/Simula/Kvasir-VQA-x1/blob/main/notebooks/usage.ipynb) - **Published in:** *Data Engineering in Medical Imaging (DEMI)*, **MICCAI 2025** - **Springer Chapter:** [SpringerLink DOI:10.1007/978-3-032-08009-7_6](https://link.springer.com/chapter/10.1007/978-3-032-08009-7_6) ## 📊 Model Summary | Model | Base Model | Hugging Face | Training Logs (W&B) | |:------|:------------|:-------------|:--------------------| | **Qwen2.5-VL-KvasirVQA-x1-ft** | Qwen2.5-VL-7B-Instruct | [🔗 SimulaMet/Qwen2.5-VL-KvasirVQA-x1-ft](https://huggingface.co/SimulaMet/Qwen2.5-VL-KvasirVQA-x1-ft) | [W&B Run 7mk4gz8s](https://wandb.ai/ubl/Kvasir-VQA-x1/runs/7mk4gz8s) | | **Qwen2.5-VL-Transf-KvasirVQA-x1-ft** | Qwen2.5-VL-7B-Transf. | [🔗 SimulaMet/Qwen2.5-VL-Transf-KvasirVQA-x1-ft](https://huggingface.co/SimulaMet/Qwen2.5-VL-Transf-KvasirVQA-x1-ft) | [W&B Run megwnbz6](https://wandb.ai/ubl/Kvasir-VQA-x1/runs/megwn...

Source context: 25 downloads · 0 likes · Pipeline visual-question-answering · Library peft · Repo SimulaMet/Qwen2.5-VL-KvasirVQA-x1-ft

Source context: 32 downloads · 0 likes · Pipeline visual-question-answering · Library peft · Repo SimulaMet/Qwen2.5-VL-KvasirVQA-x1-ft