Research code, notebooks, and small utilities for the paper:
GIV-CXR: Densely Grounded, Visually Interpretable Chest X-ray Question Answering Dataset
This repo is intentionally pretty simple. I want it to look like an actual student research repo, not a polished package.
Main things in here:
- small dataset loaders for local GIV-CXR artifacts
- exact-match and bbox-IoU evaluation code
- paper baseline config files
- a few notebooks I used while working on the project
- some optional analysis scripts that were useful during experiments
If you are opening this repo for the first time:
- read this file
- open qwen25vl_giv_cxr_bbox_input_finetuning.ipynb or qwen25vl_giv_cxr_bbox_output_finetuning.ipynb if you care about the Qwen fine-tuning runs
- open notebooks/giv_cxr_dataset_sanity_checks.ipynb for a quick local data sanity notebook
python3.11 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e ".[dev]"If you want the heavier analysis stack too:
pip install -e ".[analysis]"If you mostly want the notebook pile and do not want to think too hard about which one needs what, use:
pip install -e ".[notebooks]"If you only want the Qwen / Llama fine-tuning notebooks, use:
pip install -e ".[train]"That train extra is the closest match for:
- qwen25vl_giv_cxr_bbox_input_finetuning.ipynb
- qwen25vl_giv_cxr_bbox_output_finetuning.ipynb
- qwen25vl_mimic_vqa_bbox_output.ipynb
- llama32_11b_vision_giv_cxr.ipynb
- llama32_11b_vision_mimic_vqa.ipynb
The eval / metrics notebooks such as chexagent_mimic_vqa_eval.ipynb and medgemma_giv_cxr_inference.ipynb are a bit more mixed, which is why .[notebooks] exists now.
Small caveat: the model notebooks were clearly written around GPU-heavy environments, so .[train] and .[notebooks] mirror the Python package stack, but you may still need a machine-specific PyTorch/CUDA setup depending on where you run them.
notebooks/: quick exploration notebooksscripts/: tiny entry points for inspection and evalconfigs/: baseline config files used for the paper variantssrc/giv_cxr/: loaders and metricsqwen25vl_giv_cxr_bbox_input_finetuning.ipynb: Qwen 2.5-VL bbox-input fine-tuning notebookqwen25vl_giv_cxr_bbox_output_finetuning.ipynb: Qwen 2.5-VL bbox-output fine-tuning notebookqwen25vl_mimic_vqa_bbox_output.ipynb: Qwen 2.5-VL bbox-output experiments on MIMIC-VQAllama32_11b_vision_giv_cxr.ipynb: Llama 3.2 11B Vision experiments on GIV-CXRllama32_11b_vision_mimic_vqa.ipynb: Llama 3.2 11B Vision experiments on MIMIC-VQAmedgemma_giv_cxr_inference.ipynb: MedGemma inference notebook on GIV-CXRchexagent_mimic_vqa_eval.ipynb: CheXagent MIMIC-VQA evaluation notebook
There are also some optional scripts under scripts/analysis/. They are still research-style utilities, not a polished API.
For the fine-tuning notebooks specifically, the expected local data layout is still notebook-style rather than package-style. In practice they expect local folders like:
giv_cxr_train_dataset/giv_cxr_val_dataset/processed_images_224/
Inspect a local dataset artifact:
python scripts/inspect_dataset.py --path path/to/giv_cxr_train_dataset --limit 3Run the tiny example eval:
python scripts/evaluate.py --predictions tests/fixtures/sample_predictions.jsonlPrint one of the public baseline configs:
python scripts/train.py --config configs/qwen_bbox_output.yamlThe full benchmark described in the paper spans 355,293 QA pairs across 20,534 chest radiographs.
The paper experiments use:
train:150,000QA pairstest:7,500QA pairsvalidation:7,500QA pairs, supplementary only
I am not putting restricted MIMIC-CXR / Chest ImaGenome-derived images or private artifact dumps directly in this repo. If you are rerunning anything locally, just make your own artifacts/ folder and keep the actual data there.
- notebooks/README.md
- the model notebooks are still notebook-first and a bit messy, which is intentional for now
scripts/analysis/contains extra experiment utilities if you want to dig deeper