Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
image
image
tumor
int32
patient_id
int32
node_id
int32
centre_id
int32
patch_x
int32
patch_y
int32
0
0
0
0
68,284
64,558
0
0
0
0
83,435
37,704
0
0
0
0
62,122
119,338
0
0
0
0
49,840
104,477
0
0
0
0
83,634
31,801
0
0
0
0
23,482
129,014
0
0
0
0
57,233
68,466
0
0
0
0
64,146
64,264
0
0
0
0
67,105
112,118
0
0
0
0
72,213
92,298
0
0
0
0
66,488
65,035
0
0
0
0
71,077
66,763
0
0
0
0
85,756
32,314
0
0
0
0
85,187
38,569
0
0
0
0
64,643
61,708
0
0
0
0
60,707
61,620
0
0
0
0
43,297
89,700
0
0
0
0
23,837
132,556
0
0
0
0
54,219
59,395
0
0
0
0
74,135
73,247
0
0
0
0
74,503
124,571
0
0
0
0
60,130
86,668
0
0
0
0
84,135
39,723
0
0
0
0
35,117
140,689
0
0
0
0
71,429
77,066
0
0
0
0
45,183
94,530
0
0
0
0
57,905
88,412
0
0
0
0
40,955
106,250
0
0
0
0
72,967
93,122
0
0
0
0
49,429
56,629
0
0
0
0
69,831
67,027
0
0
0
0
45,019
64,345
0
0
0
0
57,532
114,177
0
0
0
0
75,928
77,812
0
0
0
0
49,709
78,644
0
0
0
0
81,661
39,586
0
0
0
0
46,670
58,756
0
0
0
0
76,038
69,170
0
0
0
0
59,389
62,782
0
0
0
0
77,453
33,385
0
0
0
0
70,184
67,439
0
0
0
0
87,294
31,465
0
0
0
0
38,137
72,354
0
0
0
0
88,046
31,501
0
0
0
0
44,011
58,445
0
0
0
0
70,595
117,131
0
0
0
0
38,189
75,462
0
0
0
0
36,344
69,631
0
0
0
0
38,463
62,799
0
0
0
0
76,633
73,222
0
0
0
0
39,148
105,158
0
0
0
0
61,295
64,356
0
0
0
0
39,245
65,744
0
0
0
0
64,459
116,057
0
0
0
0
42,395
80,182
0
0
0
0
79,767
78,772
0
0
0
0
52,891
56,091
0
0
0
0
52,762
107,965
0
0
0
0
84,928
35,294
0
0
0
0
73,559
93,582
0
0
0
0
42,455
103,240
0
0
0
0
72,040
85,161
0
0
0
0
70,265
87,677
0
0
0
0
22,907
128,946
0
0
0
0
44,596
134,161
0
0
0
0
43,200
123,430
0
0
0
0
25,233
138,185
0
0
0
0
47,644
107,378
0
0
0
0
70,957
91,615
0
0
0
0
50,625
77,518
0
0
0
0
34,995
101,785
0
0
0
0
72,958
74,555
0
0
0
0
67,713
70,542
0
0
0
0
65,254
110,484
0
0
0
0
62,826
109,617
0
0
0
0
39,614
62,805
0
0
0
0
62,174
66,112
0
0
0
0
49,680
60,753
0
0
0
0
32,595
106,556
0
0
0
0
51,989
59,984
0
0
0
0
72,242
76,767
0
0
0
0
48,099
57,531
0
0
0
0
70,848
91,651
0
0
0
0
55,128
109,765
0
0
0
0
71,817
83,418
0
0
0
0
41,792
103,467
0
0
0
0
69,236
91,412
0
0
0
0
27,051
136,076
0
0
0
0
73,559
80,757
0
0
0
0
39,709
101,603
0
0
0
0
83,369
31,229
0
0
0
0
27,874
112,292
0
0
0
0
73,159
78,167
0
0
0
0
27,491
114,660
0
0
0
0
73,060
80,007
0
0
0
0
66,397
61,420
0
0
0
0
86,147
38,180
0
0
0
0
52,478
111,785
0
0
0
0
84,661
37,080
0
0
0
0
53,879
66,657
End of preview. Expand in Data Studio

MiniCAMELYON — Patch-Level Breast Cancer Metastasis Detection

This dataset is derived from the CAMELYON17 challenge (CAncer MEtastases in LYmph nOdes challeNge), organized by the Diagnostic Image Analysis Group (DIAG) and the Department of Pathology of Radboud University Medical Center in Nijmegen, the Netherlands, as the second grand challenge in computational pathology. The original CAMELYON17 cohort comprises 1,000 H&E-stained whole-slide images of sentinel lymph node sections from breast cancer patients, collected at five medical centers in the Netherlands — Radboud UMC (RUMC), Utrecht UMC (UMCU), Rijnstate Hospital (RST), Canisius-Wilhelmina Hospital (CWZ), and LabPON — and split evenly into 500 training and 500 test slides. Slides were deliberately sourced across centers and three different scanner models so that staining and scanning variability is represented in the data.

Here we provide a Hugging Face ready, patch-level subset: a tissue-filtered sample of 512×512 patches extracted at 0.5 µm/px from a partial download of the CAMELYON17 training set, each paired with its binary tumor label. Patches are drawn under per-slide quotas rather than uniformly, which raises the tumor rate far above true prevalence without making the dataset balanced overall as most slides are negative and contribute normal patches only.

This is a subset, not the full challenge dataset. Only nodes 0 and 1 were downloaded, for approximately 121 slides.

📦 Dataset Structure

Each entry corresponds to a single patch extracted from one whole-slide image:

  • image → 512×512 RGB patch, sampled at 0.5 µm/px (≈20× magnification)
  • tumor → Binary label: normal (0) or tumor (1)
  • patient_id → Artificial patient index from the original release (0–99 in the training set)
  • node_id → Lymph node index within that patient (0–4 originally; only 0 and 1 here)
  • centre_id → Contributing medical center, centre_0centre_4
  • patch_x, patch_y → Top-left coordinate of the patch in level-0 slide space

🏷️ Labels

Patch label

The tumor field is binary, assigned geometrically from the lesion contours:

Value Class Definition
0 Normal Central region of the patch contains no annotated metastasis and at least 20% tissue
1 Tumor Central region of the patch intersects an annotated metastasis

The "central region" is the middle third of the patch (≈171×171 px of 512×512). Patches where a metastasis is present somewhere in the patch but not in the central region are ambiguous and were discarded rather than assigned to either class, following the labeling convention used by WILDS-Camelyon17.

⚙️ Preprocessing

Extraction was performed with OpenSlide and Shapely directly from the BigTIFF slides. The steps below are what distinguish this subset from a naive random-crop dump.

Tissue masking. A downsampled thumbnail (≈64× downsample) is converted to HSV and thresholded with Otsu on the saturation channel, with a floor at S > 20 and value bounds 40 < V < 235 to reject blown-out glass and dark pen marks or scanner bars. Small connected components are removed by morphological opening/closing. Uniform random sampling over slide dimensions would return overwhelmingly blank glass, since a lymph node section occupies a small fraction of the slide area.

Lesion geometry with exclusions honored. Annotations are ASAP XML polygons in level-0 coordinates. Each <Annotation> carries a PartOfGroup attribute: metastases marks tumor, while normal marks exclusion regions inside metastases. The tumor geometry is the union of the former minus the union of the latter, so tissue carved out of a lesion is not labeled positive. Vertices are ordered by the Coordinate/@Order attribute rather than document order, and self-intersecting contours are repaired.

Class-targeted sampling. Metastases occupy a tiny fraction of tissue, so uniform sampling yields a positive rate well under 1%. Tumor patches are drawn by rejection sampling inside the lesion geometry; normal patches are drawn uniformly over the tissue mask and rejected if they touch the lesion geometry at all. Per-slide quotas cap each class. Near-duplicate centers are suppressed on a half-patch grid.

Magnification. Slides are scanned at 0.23–0.25 µm/px, but not identically across centers. Rather than reading a fixed pyramid level, the target 0.5 µm/px is resolved per slide against its openslide.mpp-x property, so physical scale is constant across the dataset even where native resolution differs.

Alpha compositing. read_region returns RGBA; transparent regions are composited onto white, not converted directly to RGB, which would render slide margins black.

Un-annotated slides. Only 50 of the 500 CAMELYON17 training slides carry lesion-level annotations (10 per center). Slides without an XML are used as a normal-patch source only when stages.csv confirms them as negative; slides labeled itc, micro or macro without annotation are skipped entirely, since the metastasis location is unknown and every patch would be a potential false negative.

Not included: stain normalization, color augmentation, blur or artifact detection. These are left to the consumer, deliberately — inter-center stain variation is the scientifically interesting property of CAMELYON17 and normalizing it away at the dataset level would defeat the point.

🚀 Usage

from datasets import load_dataset
import matplotlib.pyplot as plt

ds = load_dataset("chehablab/MiniCAMELYON", split="train")
sample = ds[0]

plt.imshow(sample["image"])
plt.axis("off")
plt.title(
    f"{sample['slide_id']} | ({sample['patch_x']}, {sample['patch_y']}) | "
    f"{ds.features['tumor'].int2str(sample['tumor'])} | "
    f"slide: {ds.features['stage'].int2str(sample['stage'])} | "
    f"{ds.features['centre_id'].int2str(sample['centre_id'])}"
)
plt.show()

Patient-level splitting:

import numpy as np

patients = np.array(sorted(set(ds["patient_id"])))
rng = np.random.default_rng(0)
rng.shuffle(patients)
val_patients = set(patients[: int(0.2 * len(patients))].tolist())

val_ds   = ds.filter(lambda x: x["patient_id"] in val_patients)
train_ds = ds.filter(lambda x: x["patient_id"] not in val_patients)

📚 Citation

If you use this dataset, please acknowledge Chehab Lab and cite the original CAMELYON publications:

@article{litjens2018camelyon,
  title   = {1399 {H\&E}-stained sentinel lymph node sections of breast cancer patients: the {CAMELYON} dataset},
  author  = {Litjens, Geert and Bandi, Peter and Ehteshami Bejnordi, Babak and Geessink, Oscar and Balkenhol, Maschenka and Bult, Peter and Halilovic, Altuna and Hermsen, Meyke and van de Loo, Rob and Vogels, Rob and Manson, Quirine F and Stathonikos, Nikolas and Baidoshvili, Alexi and van Diest, Paul and Wauters, Carla and van Dijk, Marcory and van der Laak, Jeroen},
  journal = {GigaScience},
  volume  = {7},
  number  = {6},
  pages   = {giy065},
  year    = {2018},
  doi     = {10.1093/gigascience/giy065}
}

@article{bandi2019detection,
  title   = {From Detection of Individual Metastases to Classification of Lymph Node Status at the Patient Level: The {CAMELYON17} Challenge},
  author  = {Bandi, Peter and Geessink, Oscar and Manson, Quirine and van Dijk, Marcory and Balkenhol, Maschenka and Hermsen, Meyke and Ehteshami Bejnordi, Babak and Lee, Byungjae and Paeng, Kyunghyun and Zhong, Aoxiao and others},
  journal = {IEEE Transactions on Medical Imaging},
  volume  = {38},
  number  = {2},
  pages   = {550--560},
  year    = {2019},
  doi     = {10.1109/TMI.2018.2867350}
}

@article{ehteshami2017diagnostic,
  title   = {Diagnostic Assessment of Deep Learning Algorithms for Detection of Lymph Node Metastases in Women With Breast Cancer},
  author  = {Ehteshami Bejnordi, Babak and Veta, Mitko and van Diest, Paul Johannes and van Ginneken, Bram and Karssemeijer, Nico and Litjens, Geert and van der Laak, Jeroen A W M and others},
  journal = {JAMA},
  volume  = {318},
  number  = {22},
  pages   = {2199--2210},
  year    = {2017},
  doi     = {10.1001/jama.2017.14585}
}

Challenge homepage: https://camelyon17.grand-challenge.org/

Original data repository: http://gigadb.org/dataset/100439

Viewer and annotation tooling: https://github.com/computationalpathologygroup/ASAP


📜 License

The CAMELYON16 and CAMELYON17 data are released under the Creative Commons CC0 1.0 Universal public domain dedication, and this derivative dataset inherits the same terms.

No rights are reserved. You may copy, modify, distribute and use the data, including for commercial purposes, without asking permission. Citation is not legally required under CC0 but is expected as a matter of academic practice — please cite the works above.

The original data collection was approved by the ethics committee of Radboud University Medical Center under 2016-2761, with the need for informed consent waived.

CC0

Chehab Lab @ 2026

Downloads last month
15

Collection including chehablab/MiniCAMELYON17