Dataset Viewer
Auto-converted to Parquet Duplicate
The dataset viewer is not available for this split.
Parquet error: Scan size limit exceeded: attempted to read 495640597 bytes, limit is 300000000 bytes Make sure that 1. the Parquet files contain a page index to enable random access without loading entire row groups2. otherwise use smaller row-group sizes when serializing the Parquet files
Error code:   TooBigContentError

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

ZJU Eye-Pretrain Dataset

Unified multi-source ophthalmological imaging dataset for foundation model pretraining and downstream tasks.

1.1M images spanning 26 cohorts with a strict 41-column unified manifest schema.

Composition

Source Images Modalities Cohorts
Private Shanghai DRI OCT Triton (SS-OCT) 419,042 oct_bscan + fundus_color + slo_gray 1
Public Fundus 198,629 fundus_color (+ GAMMA OCT) 6
Public OCT 488,705 oct_bscan 19
Total 1,106,376 26

See DATASET_OVERVIEW.md for full details per cohort (devices, regions, masks, demographics).

Quick Start

from datasets import load_dataset, concatenate_datasets, Image

# === Load by batch ===
ds_priv = load_dataset("mayberichard/zju-eye-pretrain", "private_topcon")
ds_fun  = load_dataset("mayberichard/zju-eye-pretrain", "public_fundus")
ds_oct  = load_dataset("mayberichard/zju-eye-pretrain", "public_oct")

# === Load by single cohort (28 available, see configs in YAML above) ===
ds = load_dataset("mayberichard/zju-eye-pretrain", "kermany")    # 109k
ds = load_dataset("mayberichard/zju-eye-pretrain", "octa500")    # 120k

# === IMPORTANT: cast binary columns to Image for auto-decode ===
ds = ds.cast_column("image", Image())
# For cohorts with masks (DRIVE/IDRiD/REFUGE2/AROI/OIMHS/AMD-SD/Chiu/Glaucoma/OCTA500/RETOUCH):
for col in ds["train"].features:
    if col.endswith("_mask") and str(ds["train"].features[col]) == "Value('binary')":
        ds = ds.cast_column(col, Image())

# Each row after cast:
#   image: PIL.Image                                  (auto-decoded)
#   {vessel|fov|layer|lesion|disc_cup|...}_mask: PIL.Image or None
#   image_id, study_id, patient_hash, modality, anatomy, severity, diagnosis_group, ...

# === Concat 3 batches manually if needed ===
# Note: schemas differ across batches (mask column sets), so use only shared cols:
shared = ["image_id", "cohort", "study_id", "patient_hash", "modality",
          "anatomy", "device_vendor", "device_model", "severity",
          "diagnosis_group", "image", "bscan_index"]
all_ds = concatenate_datasets([
    ds_priv["train"].select_columns(shared).cast_column("image", Image()),
    ds_fun["train"].select_columns(shared).cast_column("image", Image()),
    ds_oct["train"].select_columns(shared).cast_column("image", Image()),
])
# 1.1M images total, mask cols dropped (use per-batch load if you need masks)

# === Streaming for big training runs (avoids downloading all 287 GB) ===
ds = load_dataset("mayberichard/zju-eye-pretrain", "public_oct", streaming=True)
ds = ds.cast_column("image", Image())
for row in ds["train"]:
    img = row["image"]   # PIL Image, lazy-decoded
    ...

Schema (41-column manifest, identical across all batches)

cohort, study_id, patient_hash, visit_date, eye,
device_vendor, device_model, device_serial_hash, device_software_version,
hospital_domain, ethnicity,
image_quality_score, image_quality_band,
diagnosis_group, lesion_tags, lesion_location, layer_involvement, severity,
diagnosis_source, label_confidence, schema_version,
image_id, file_path, file_format,
modality, anatomy, device_technology, scan_protocol,
scan_x_mm, bscan_index,
image_height_px, image_width_px, axial_resolution_um,
has_segmentation, n_layers_visible,
fovea_x_norm, crt_um, choroid_thickness_um,
oct_footprint_bbox_fundus, oct_footprint_bbox_slo,
is_valid

Plus per-image image bytes and per-cohort mask columns.

Captions

Each image has 5 captions (4 L1 variants + 1 L3 derived). Total 5.5M captions in captions/.

from datasets import load_dataset
caps = load_dataset("mayberichard/zju-eye-pretrain", "captions_oct")
# join on image_id with the images config

Licensing

This dataset aggregates multiple sources with mixed licenses. See LICENSE for per-cohort license terms. Users are responsible for compliance with the original license of each cohort.

Private Shanghai Topcon data is included for research convenience. Commercial use is prohibited.

Citation

If you use this dataset, please cite the original source for each cohort used (see DATASET_OVERVIEW.md).

Versioning & Updates

This dataset supports incremental updates. New cohorts can be added without touching existing data via additional shards in data/<batch>/. Schema migrations preserve old *_v1.parquet alongside new versions.

Downloads last month
132