YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

CXR-VLM: Unified Vision-Language Model for Chest X-ray Interpretation

A lightweight Vision-Language Model for three tasks on chest X-rays:

  1. Findings Generation β€” detailed radiological findings
  2. Impression Generation β€” concise clinical summary
  3. Visual Question Answering (VQA) β€” answer specific clinical questions

Architecture (based on RaDialog)

CXR Image
    β”‚
BioViL-T Encoder (frozen)     ← domain-specific CXR encoder
    β”‚  [768-dim patch features]
MLP Projection Layer (trained) ← align to LLM space
    β”‚  [32 image tokens]
    + CheXpert Findings (structured labels, optional)
    + Task Instruction Prompt
    β”‚
Vicuna-7B + LoRA (LLM trained with LoRA)
    β”‚
Output Text (findings / impression / answer)

Project Structure

cxr_vlm/
β”œβ”€β”€ configs/
β”‚   β”œβ”€β”€ model_config.yaml       # model hyperparameters
β”‚   └── train_config.yaml       # training hyperparameters
β”œβ”€β”€ model/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ image_encoder.py        # BioViL-T wrapper
β”‚   β”œβ”€β”€ projection.py           # MLP alignment layer
β”‚   β”œβ”€β”€ chexpert_classifier.py  # CheXpert structured findings classifier
β”‚   └── cxr_vlm.py              # full model (encoder + projection + LLM)
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ dataset.py              # CXRInstructDataset (load later)
β”‚   β”œβ”€β”€ prompt_templates.py     # instruction templates for 3 tasks
β”‚   └── collator.py             # DataCollator for variable-length inputs
β”œβ”€β”€ training/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ trainer.py              # custom HuggingFace Trainer
β”‚   └── train.py                # main training entry point
β”œβ”€β”€ evaluation/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ metrics.py              # BLEU, ROUGE, ClinicalF1, BERTScore
β”‚   └── evaluate.py             # evaluation entry point
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ logger.py               # logging setup
β”‚   └── checkpoint.py           # save/load utilities
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ train.sh                # training shell script
β”‚   └── evaluate.sh             # evaluation shell script
└── README.md

Setup

conda create -n cxr_vlm python=3.10
conda activate cxr_vlm
conda install pytorch==2.0.1 torchvision==0.15.2 pytorch-cuda=11.7 -c pytorch -c nvidia
pip install -r requirements.txt

Training

bash scripts/train.sh

Evaluation

bash scripts/evaluate.sh
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support