--- pretty_name: MedOptm Surgical VQA (polished) license: apache-2.0 language: - en task_categories: - visual-question-answering - image-to-text tags: - medical - biomedical - surgical - vqa - visual-question-answering - multimodal - biomedica size_categories: - 100K **This VQA dataset is derived from the **BIOMEDICA** vision–caption data.** > The questions and answers were **generated from BIOMEDICA figure captions** — > the images and their captions come from BIOMEDICA (itself built from PubMed > Central Open Access), and each `(question, answer)` pair was derived from the > figure's caption. The original caption is kept in every row (`original_caption`) > so the derivation stays auditable. > ⚠️ **Research use only — not for clinical use.** Answers are derived from figure > captions, not written or reviewed by clinicians, and can be incomplete or > wrong. Do not use this dataset to make or support medical decisions. --- ## Where the code lives Everything that loads, cleans, inspects and consumes this dataset is open-source in the MedOptm repository: - **GitHub repo:** - **Data pipeline code:** [`src/medoptm/data/`](https://github.com/Devpatel1012/MedOptm-VLM/tree/main/src/medoptm/data) - [`dataset.py`](https://github.com/Devpatel1012/MedOptm-VLM/blob/main/src/medoptm/data/dataset.py) — loads these parquet files, decodes the images, and builds the train/val/test DataLoaders. - [`preprocessing.py`](https://github.com/Devpatel1012/MedOptm-VLM/blob/main/src/medoptm/data/preprocessing.py) — the `light_scrub()` text cleaner that removed demographics/measurements from the answer text. - [`sampling.py`](https://github.com/Devpatel1012/MedOptm-VLM/blob/main/src/medoptm/data/sampling.py) — pulls small random samples out for inspection. - **BIOMEDICA → VQA inspection notebooks:** [`01_biomedica_data_inspection.ipynb`](https://github.com/Devpatel1012/MedOptm-VLM/blob/main/notebooks/01_biomedica_data_inspection.ipynb) and [`02_biomedica_vqa_inspection.ipynb`](https://github.com/Devpatel1012/MedOptm-VLM/blob/main/notebooks/02_biomedica_vqa_inspection.ipynb) show the BIOMEDICA caption data and the derived VQA side by side. --- ## Dataset structure A single `train` split, stored as parquet shards under `data/`. Each row: | Column | Type | Description | |---|---|---| | `image` | image (bytes) | The biomedical/surgical figure from BIOMEDICA. With 🤗 `datasets` this is cast to a PIL image automatically. | | `question` | string | A question about the image. ~56 characters on average. | | `answer` | string | The answer, derived from the figure caption. ~77 characters on average. | | `original_caption` | string | The BIOMEDICA figure caption the Q&A was derived from. ~219 characters on average. Kept for provenance and for caption-style training. | | `original_filename` | string | The BIOMEDICA parquet shard this row came from. | | `original_row_index` | int64 | The row index within that shard (`-1` where unknown). | The dataset is **not pre-split** — MedOptm splits it at load time (80/10/10 train/val/test, `seed=42`). ### Example ```text question: "Where in the spine were pedicle screws placed?" answer: "The pedicle screws were placed in the lumbar spine." original_caption: "The pedicle screws were placed percutaneously (A). The positions of the screws are shown in the X-ray lateral view (B), and the intervertebral ..." ``` --- ## Usage ```python from datasets import load_dataset ds = load_dataset("devpatel1012/polished-vlm-dataset", split="train") row = ds[0] print(row["question"], "->", row["answer"]) row["image"] # a PIL image ``` Reproduce MedOptm's exact split: ```python split = ds.shuffle(seed=42).train_test_split(test_size=0.2) train = split["train"] val_test = split["test"].train_test_split(test_size=0.5) val, test = val_test["train"], val_test["test"] ``` --- ## How it was built 1. **Source.** Figures and their captions from **BIOMEDICA** (derived from PubMed Central Open Access). 2. **Q&A generation.** For each figure, a `(question, answer)` pair was generated from its BIOMEDICA caption. The caption is retained as `original_caption` so each answer can be traced back to its source text. 3. **Light scrubbing.** Answer text was passed through `light_scrub()` ([`preprocessing.py`](https://github.com/Devpatel1012/MedOptm-VLM/blob/main/src/medoptm/data/preprocessing.py)) to remove demographic details and measurements. --- ## Provenance & licensing This is a **derived** dataset. Its images and captions come from **BIOMEDICA**, which is built from **PubMed Central Open Access (PMC-OA)**. PMC-OA is a *mixture* of Creative Commons licences — some articles allow redistribution with attribution, others carry non-commercial or no-derivatives terms. **A derived dataset cannot be more permissive than its source.** Before making this public: - Read BIOMEDICA's dataset terms and licence, and PMC-OA's reuse terms. - Set the `license:` field in the metadata block above to match. - Keep the attribution to BIOMEDICA and PMC-OA intact. ## Limitations - Answers are **caption-derived**, not clinician-authored or clinically validated. - Figures come from published literature, so they skew toward notable/illustrative cases rather than a representative clinical distribution. - Multi-panel figures (A/B/C …) are kept whole, so a question may refer to only one panel. - De-identification of the image **pixels** has not been exhaustively verified — published figures are normally de-identified, but spot-check before relying on it. ## Citation Please cite **BIOMEDICA** (the upstream source) and this derived release. ```bibtex @misc{medoptm_surgical_vqa, title = {MedOptm Surgical VQA (polished)}, author = {Dev Patel}, year = {2026}, url = {https://huggingface.co/datasets/devpatel1012/polished-vlm-dataset}, note = {Derived from the BIOMEDICA vision--caption dataset (PubMed Central Open Access).} } ``` ## Links - 🧠 **Model & code:** - 🗂️ **Upstream data:** BIOMEDICA