Skip to main content

Benchmark toolkit for DrVD

Project description

DrVD-Bench: Do Vision-Language Models Reason Like Human Doctors in Medical Image Diagnosis?

paperkagglehuggingfacegithub

This repository is the official implementation of the paper: DrVD-Bench: Do Vision-Language Models Reason Like Human Doctors in Medical Image Diagnosis?

Introduction

Vision–language models (VLMs) exhibit strong zero-shot generalization on natural images and show early promise in interpretable medical image analysis. However, existing benchmarks do not systematically evaluate whether these models truly reason like human clinicians or merely imitate superficial patterns.
To address this gap, we propose DrVD-Bench, the first multimodal benchmark for clinical visual reasoning. DrVD-Bench consists of three modules: Visual Evidence Comprehension, Reasoning Trajectory Assessment, and Report Generation Evaluation, comprising 7 789 image–question pairs.
Our benchmark covers 20 task types, 17 diagnostic categories, and five imaging modalities—CT, MRI, ultrasound, X-ray, and pathology. DrVD-Bench mirrors the clinical workflow from modality recognition to lesion identification and diagnosis.
We benchmark 19 VLMs (general-purpose & medical-specific, open-source & proprietary) and observe that performance drops sharply as reasoning complexity increases. While some models begin to exhibit traces of human-like reasoning, they often rely on shortcut correlations rather than grounded visual understanding. DrVD-Bench therefore provides a rigorous framework for developing clinically trustworthy VLMs.

cover image

Quick Start

Prepare Environment

pip3 install -r requirements.txt

Obtain DeepSeek API Key

Report generation will use DeepSeek to extract report keywords, and instruction-following weaker models can also leverage DeepSeek to extract answers from their outputs.
You can apply for an API key on the DeepSeek platform.
For more details, please refer to the official documentation: DeepSeek API Docs.

Obtain Model Outputs

  1. Download the dataset from Kaggle or Hugging Face.
  2. Run inference with your model and append the results to the model_response field in the corresponding files.
  3. model_response format requirements
    • visual_evidence_qa.jsonl / independent_qa.jsonl: Single letter A / B / C
    • joint_qa.jsonl: List containing only letters, separated by commas, e.g., ['B','D','A']
    • report_generation.jsonl: Full string

Inference Example Using Qwen-2.5-VL-72B API

The Qwen-2.5-VL-72B API can be obtained on the Alibaba Cloud Bailian platform (link).

· task - joint_qa.jsonl

python qwen2.5vl_example.py \
  --API_KEY="your_qwen_api_key" \
  --INPUT_PATH="/path/to/joint_qa.jsonl" \
  --OUTPUT_PATH="/path/to/result.jsonl" \
  --IMAGE_ROOT='path/to/benchmark/data/root' \
  --type="joint"

· other tasks

python qwen2.5vl_example.py \
  --API_KEY="your_qwen_api_key" \
  --INPUT_PATH="/path/to/qa.jsonl" \
  --OUTPUT_PATH="/path/to/result.jsonl" \
  --IMAGE_ROOT='path/to/benchmark/data/root' \
  --type="single"

Mapping Script

Applicable for instruction-following weaker models; if your model cannot standardize outputs according to the above format, you can use the following script to extract option answers from the model_response field:

python map.py \
  --API_KEY="your_deepseek_api_key" \
  --INPUT_FILE="/path/to/model_result.jsonl" \
  --OUTPUT_FILE="/path/to/model_result_mapped.jsonl"

Compute Metrics

task - visual_evidence_qa.jsonl / independent_qa.jsonl

python compute_choice_metric.py \
  --json_path="/path/to/results.jsonl" \
  --type='single'

task - joint_qa.jsonl

python compute_choice_metric.py \
  --json_path="/path/to/results.jsonl" \
  --type='joint'

task - report_generation.jsonl

python report_generation_metric.py \
  --API_KEY='your_deepseek_api_key' \
  --JSON_PATH='/path/to/results.jsonl'

Contact

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

drvd_bench-0.1.0.tar.gz (5.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

drvd_bench-0.1.0-py3-none-any.whl (5.6 MB view details)

Uploaded Python 3

File details

Details for the file drvd_bench-0.1.0.tar.gz.

File metadata

  • Download URL: drvd_bench-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for drvd_bench-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b88a6fb9896c1ec00194b17ad427e6803fa5e92496a162437027f1785fcc8f07
MD5 dd27b3fb8333a8573d5b4fd25ae80cea
BLAKE2b-256 98934a0f8218f2b7fda5a4689ab2ea8d895752d996422070fe4d458d6cefc301

See more details on using hashes here.

File details

Details for the file drvd_bench-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: drvd_bench-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for drvd_bench-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 275c104aab6dde38bb44fefcfe380ce83a6859772d64d0ffffde3cd8022f5b59
MD5 0ad7a65251330f7aa2813c1e6ec910b8
BLAKE2b-256 935b032d837c22654c5121b567f0cd2f5b7a7fd4b742cee3a6bff5b2a679a642

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page