id stringlengths 11 16 | images listlengths 1 1 | conversations listlengths 2 2 | modality stringclasses 11
values | resolutions listlengths 1 1 |
|---|---|---|---|---|
alignment_2 | [
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCACSAJYDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgED... | [
{
"role": "user",
"content": "Write a terse but informative summary of the image\n<image>"
},
{
"role": "assistant",
"content": "Uninfected macrophages showed discrete fluorescence signals, considered as “constitutive or basal”"
}
] | OCT | [
[
150,
146
]
] |
alignment_8 | [
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAEGATMDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgED... | [
{
"role": "user",
"content": "Compose a concise yet comprehensive narrative capturing the picture's essence\n<image>"
},
{
"role": "assistant",
"content": "crystal grown with 5 nm of TAPC as sublayer and 5 wt.% of F6-TCNNQ (30 nm seed, 80 nm bulk)"
}
] | Ultrasound | [
[
307,
262
]
] |
alignment_17 | [
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAB/AKIDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgED... | [
{
"role": "user",
"content": "<image>\nIllustrate the image through a descriptive explanation"
},
{
"role": "assistant",
"content": "The puncta of autophagosomes were counted under a fluorescence microscope and plotted in a bar graph with statistical analysis"
}
] | Ultrasound | [
[
162,
127
]
] |
alignment_19 | [
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAD4AVIDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgED... | [
{
"role": "user",
"content": "<image>\nNarrate the contents of the image with precision"
},
{
"role": "assistant",
"content": "Abdominal contrast-enhanced CT showed contrast failure (white arrow) and extension of surrounding inflammation on the 2nd hospital day."
}
] | CT Scan | [
[
338,
248
]
] |
alignment_20 | [
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAFGAUkDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgED... | [
{
"role": "user",
"content": "<image>\nShare a concise interpretation of the image provided."
},
{
"role": "assistant",
"content": "shows a 3D visualization of T2-W Image after outer segmentation"
}
] | CT Scan | [
[
329,
326
]
] |
alignment_23 | ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0(...TRUNCATED) | [{"role":"user","content":"Unfold the main visual narrative conveyed in the given picture.\n<image>"(...TRUNCATED) | X-Ray | [
[
742,
495
]
] |
alignment_28 | ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0(...TRUNCATED) | [{"role":"user","content":"Clarify the contents of the displayed image with great detail\n<image>"},(...TRUNCATED) | OCT | [
[
80,
84
]
] |
alignment_30 | ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0(...TRUNCATED) | [{"role":"user","content":"<image>\nFocus on the major attributes and context depicted in the photo.(...TRUNCATED) | Ultrasound | [
[
157,
147
]
] |
alignment_31 | ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0(...TRUNCATED) | [{"role":"user","content":"Share a comprehensive rundown of the presented image\n<image>"},{"role":"(...TRUNCATED) | Ultrasound | [
[
377,
297
]
] |
alignment_33 | ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0(...TRUNCATED) | [{"role":"user","content":"<image>\nWrite a terse but informative summary of the image"},{"role":"as(...TRUNCATED) | OCT | [
[
342,
215
]
] |
Website 🤖 7B Model 🤖 8B Model based on InternVL3 🤖 32B Model MedEvalKit Technical Report Lingshu MCP
Lingshu Medical MLLM Training Data (Medical Domain)
This dataset contains the medical-domain training data used in the multi-stage training of the Lingshu Medical Multimodal Large Language Model (MLLM). General-domain data has been removed; only medical data is included.
The training framework follows a "shallow-to-deep" progression comprising three sequential stages:
- Medical Shallow Alignment — Establish effective alignment between diverse medical imaging modalities and their corresponding textual descriptions.
- Medical Deep Alignment — Comprehensively integrate medical knowledge into the MLLM with enriched, semantically complex medical image-text pairs.
- Medical Instruction Tuning — Refine the model's instruction-following capability across a broad spectrum of clinical tasks.
Please refer to our technical report for the detailed description of our training data.
Dataset Overview
| Stage | File Pattern | Size | Description |
|---|---|---|---|
| Stage 1 | stage_1_release_data_encoded.jsonl |
~13 GB | Medical Shallow Alignment data |
| Stage 2 | stage_2_release_data_encoded_part_*.jsonl |
~820 GB (41 chunks) | Medical Deep Alignment data |
| Stage 3 | stage_3_release_data_encoded_part_*.jsonl |
~2.5 TB (124 chunks) | Medical Instruction Tuning data |
Total size: ~3.3 TB
Files exceeding 20 GB are split into chunks on line boundaries. Each chunk is a valid JSONL file and can be processed independently. To reconstruct the full dataset for a stage, simply concatenate all parts in order.
Data Format
Each line is a JSON object with the following fields:
{
"id": "alignment_1",
"images": ["data:image/jpeg;base64,..."],
"conversations": [
{"role": "user", "content": "Write a description of the image\n<image>"},
{"role": "assistant", "content": "The image shows..."}
],
"modality": "CT Scan",
"resolutions": [[width, height]]
}
Please note that the modality of some samples are predicted by VLM and may not be 100% correct.
| Field | Type | Description |
|---|---|---|
id |
string | Unique sample identifier (alignment_* for stages 1-2, instruction_* for stage 3) |
images |
list[string] | Base64-encoded images as data URIs (data:image/jpeg;base64,...) |
conversations |
list[dict] | Multi-turn conversation in role/content format. The <image> token marks where image(s) should be inserted. |
modality |
string | (Stages 1-2 only) Medical imaging modality (e.g., "CT Scan", "MRI", "X-Ray", "Histopathology") |
resolutions |
list[list[int]] | (Stages 1-2 only) Original image resolutions as [width, height] pairs |
Stage Details
Stage 1: Medical Shallow Alignment
- Goal: Enable the model to encode medical images and generate corresponding descriptions accurately.
- Training strategy: LLM frozen; only the vision encoder and projector are fine-tuned.
- Data characteristics: Coarsely annotated medical image-caption pairs with relatively short and concise captions.
Stage 2: Medical Deep Alignment
- Goal: Deepen the model's domain knowledge and achieve finer-grained vision-language alignment.
- Training strategy: All model parameters (LLM, vision encoder, projector) are unfrozen for end-to-end fine-tuning.
- Data characteristics: Significantly expanded modality diversity, linguistically complex and structurally complete captions, including synthetic image-caption pairs generated from medical image classification and segmentation tasks.
Stage 3: Medical Instruction Tuning
- Goal: Refine the model's ability to comprehend and execute task-specific instructions across various medical use cases.
- Training strategy: All parameters unlocked for large-scale, end-to-end optimization.
- Data characteristics: Diverse instruction formats including image descriptions, question-answer pairs, multiple-choice questions, diagnosis queries, clinical report generation, anatomical structure localization, multi-image reasoning, multi-turn dialogues, and chain-of-thought reasoning.
Imaging Modalities Covered
The dataset covers a wide range of medical imaging modalities, including:
- X-Ray / Chest X-Ray
- CT Scan
- MRI (Magnetic Resonance Imaging)
- Ultrasound
- Histopathology
- Dermoscopy
- Microscopy
- OCT (Optical Coherence Tomography)
- Fundus Photography
- Endoscopy
- And more
Downloading the Dataset
The dataset is hosted at lingshu-medical-mllm/lingshu_training_data_medical_domain.
Option 1: Using the datasets library
Load a specific stage by pattern-matching its chunked files:
from datasets import load_dataset
REPO_ID = "lingshu-medical-mllm/lingshu_training_data_medical_domain"
# Stage 1 — Medical Shallow Alignment
stage1 = load_dataset(
REPO_ID,
data_files="stage_1_release_data_encoded.jsonl",
split="train",
)
# Stage 2 — Medical Deep Alignment
stage2 = load_dataset(
REPO_ID,
data_files="stage_2_release_data_encoded_part_*.jsonl",
split="train",
)
# Stage 3 — Medical Instruction Tuning
stage3 = load_dataset(
REPO_ID,
data_files="stage_3_release_data_encoded_part_*.jsonl",
split="train",
)
For very large stages (Stage 2 and Stage 3), use streaming mode to avoid materializing the full dataset on disk:
stage3_stream = load_dataset(
REPO_ID,
data_files="stage_3_release_data_encoded_part_*.jsonl",
split="train",
streaming=True,
)
for sample in stage3_stream:
# process sample
pass
Option 2: Using huggingface_hub (recommended for full downloads)
For downloading the raw JSONL files directly (e.g., to a local disk or NAS for training), use snapshot_download. This is efficient for multi-TB downloads and supports resumption:
from huggingface_hub import snapshot_download
REPO_ID = "lingshu-medical-mllm/lingshu_training_data_medical_domain"
# Download the entire dataset
local_dir = snapshot_download(
repo_id=REPO_ID,
repo_type="dataset",
local_dir="./lingshu_data",
)
# Or download only a specific stage
local_dir = snapshot_download(
repo_id=REPO_ID,
repo_type="dataset",
local_dir="./lingshu_data",
allow_patterns=["stage_2_release_data_encoded_part_*.jsonl"],
)
To download a single chunk:
from huggingface_hub import hf_hub_download
path = hf_hub_download(
repo_id="lingshu-medical-mllm/lingshu_training_data_medical_domain",
filename="stage_3_release_data_encoded_part_000.jsonl",
repo_type="dataset",
local_dir="./lingshu_data",
)
Usage
Loading a single chunk
import json
data = []
with open("stage_1_release_data_encoded.jsonl", "r") as f:
for line in f:
data.append(json.loads(line))
Streaming through chunked files
import json
from pathlib import Path
def stream_stage(stage_pattern: str):
"""Stream all samples from a stage's chunked files."""
for path in sorted(Path(".").glob(stage_pattern)):
with open(path, "r") as f:
for line in f:
yield json.loads(line)
# Example: iterate through all Stage 3 data
for sample in stream_stage("stage_3_release_data_encoded_part_*.jsonl"):
# process sample
pass
Decoding images
import base64
from io import BytesIO
from PIL import Image
def decode_image(data_uri: str) -> Image.Image:
"""Decode a base64 data URI to a PIL Image."""
base64_str = data_uri.split("base64,")[1]
image_bytes = base64.b64decode(base64_str)
return Image.open(BytesIO(image_bytes))
Privacy and Data Disclaimer
Notice: All data included in this dataset are sourced strictly from publicly available datasets and open academic repositories. The dataset contains no personally identifiable information (PII) or protected health information (PHI), and does not compromise or disclose the personal privacy of individual patients.
Citation
If you use this dataset, please cite the Lingshu paper:
@article{xu2025lingshu,
title={Lingshu: A Generalist Foundation Model for Unified Multimodal Medical Understanding and Reasoning},
author={Xu, Weiwen and Chan, Hou Pong and Li, Long and Aljunied, Mahani and Yuan, Ruifeng and Wang, Jianyu and Xiao, Chenghao and Chen, Guizhen and Liu, Chaoqun and Li, Zhaodonghui and others},
journal={arXiv preprint arXiv:2506.07044},
year={2025}
}
License
This dataset is released under the MIT License.
- Downloads last month
- 3,231