Upload README.md with huggingface_hub
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859---tags:- chest-xray- radiology- report-generation- mimic-cxr- vision-encoderlicense: apache-2.0---
# LAPVQA — Pretrain (Captioning)
Part of the [LAPVQA collection](https://huggingface.co/collections/dmusingu/lapvqa).
## Description
A **ViT-L/14 encoder + 6-layer causal decoder** trained from scratch on [MIMIC-CXR](https://physionet.org/content/mimic-cxr)to generate full radiology reports from chest X-ray images.Unlike the contrastive pretrain variants, this model uses a generative objective, forcing the encoderto retain fine-grained spatial information sufficient for region-level text generation.The encoder weights from this model serve as the strongest feature extractor in the LAPVQA downstream tasks.
## Architecture
| Component | Detail ||---|---|| Vision backbone | ViT-L/14, 24-layer, 1024-dim, 16-head, patch 14, 384 px || Captioning decoder | 6-layer causal transformer, 512-dim, GPT-2 vocab (50 257) || Loss | Cross-entropy over report tokens || Training data | MIMIC-CXR (physionet.org/content/mimic-cxr) |
## Downstream Evaluation (frozen encoder)
| Dataset | Mean AUC ||---|---|| NIH CXR-14 (14-class, linear probe) | — || CheXpert-5 (5-class, linear probe) | — |
The `encoder_final.pt` is used as a drop-in replacement for off-the-shelf encoders in theVQA, DiffVQA, and RRG downstream repos in this collection.
## Files
| File | Description ||---|---|| `encoder_final.pt` | Vision encoder weights (used as frozen feature extractor downstream) || `model_best.pt` | Full encoder + decoder at best validation CIDEr |
## Usage
```pythonimport torchfrom lapvqa.pretrain.model import CaptioningModel
ckpt = torch.load("model_best.pt", map_location="cpu")model = CaptioningModel()model.load_state_dict(ckpt)model.eval()```README.mdAdded+59