Datasets:
id stringlengths 11 11 | image unknown | inst unknown | type unknown | fold int8 1 1 | tissue stringclasses 19
values |
|---|---|---|---|---|---|
fold1_00000 | [
137,
80,
78,
71,
13,
10,
26,
10,
0,
0,
0,
13,
73,
72,
68,
82,
0,
0,
1,
0,
0,
0,
1,
0,
8,
2,
0,
0,
0,
211,
16,
63,
49,
0,
1,
0,
0,
73,
68,
65,
84,
120,
156,
236,
253,
217,
146,
92,
89,
150,
36,
138,
237,
249,
... | [
137,
80,
78,
71,
13,
10,
26,
10,
0,
0,
0,
13,
73,
72,
68,
82,
0,
0,
1,
0,
0,
0,
1,
0,
16,
0,
0,
0,
0,
41,
137,
43,
249,
0,
0,
5,
36,
73,
68,
65,
84,
120,
156,
237,
221,
235,
82,
227,
56,
16,
6,
80,
199,
155,
... | [
137,
80,
78,
71,
13,
10,
26,
10,
0,
0,
0,
13,
73,
72,
68,
82,
0,
0,
1,
0,
0,
0,
1,
0,
8,
0,
0,
0,
0,
121,
25,
247,
186,
0,
0,
3,
232,
73,
68,
65,
84,
120,
156,
237,
221,
235,
114,
155,
48,
20,
4,
224,
61,
11,
... | 1 | Breast |
fold1_00001 | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAEAAElEQVR4nOz92ZIkabalh+msambuHpGZVXVOowkILigUXPBZ+TK(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAEAAAAAApiSv5AAAFuklEQVR4nO3d63IbNxCE0VlKtMW8/7PGkChqXQmtMkviZS9YoGf(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAEeUlEQVR4nO2d4ZLbIAyEV3t+/zdu1Ol12snlLokNEjZovx9tUyM(...TRUNCATED) | 1 | Breast |
fold1_00002 | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAEAAElEQVR4nOz9SZMkWZaliTHzezyIiKq5e2RmZVGjewki9P/f4Wd(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAEAAAAAApiSv5AAAG7ElEQVR4nO2di1LbMBBFN45Defz/pzalJECHKdA0iRPJkWTt3nM(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAFf0lEQVR4nO2d67KjIBCEe5q8/xtbs7XZOntyUSNGYKD5fiVGwW6(...TRUNCATED) | 1 | Breast |
fold1_00003 | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAEAAElEQVR4nOz9aZIkWXati2mvambuEZEF4N4HoQgHzKlwHpzH+0G(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAEAAAAAApiSv5AAAHaklEQVR4nO2dbXfSQBCFF9IC9f//Vim0azx4rGKOkGwys/Ny7/O(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAFzklEQVR4nO2d3bbrKgiFJ3P4/q/MGWOfdbF+kqoRFSTfXVsDMoO(...TRUNCATED) | 1 | Breast |
fold1_00004 | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAEAAElEQVR4nGz9jZIjSZKsi8V/BIDMrOqe2d3D+7B8Fb4FH4aUK+S(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAEAAAAAApiSv5AAAEXElEQVR4nO3d4XLSUBAG0ASwvv/jioY6dayOtNgS7k12957zx7F(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAADiklEQVR4nO3c22KbMBBF0TMD///HtvrQtE1cXwSMBNLs9ZRgRUj(...TRUNCATED) | 1 | Breast |
fold1_00005 | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAEAAElEQVR4nGz96ZYbWZKlC+oZdAJgRtIjMnt19/s/Sj9F/+mqysj(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAEAAAAAApiSv5AAAFFUlEQVR4nO3d0W7bRhBAUdKxnP//3FpxEhiNAEWWIoqcpXZ2znl(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAEB0lEQVR4nO2c0ZLrKAxEW635/z9WvLV192H2ThLbGRuEWudlxkA(...TRUNCATED) | 1 | Breast |
fold1_00006 | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAEAAElEQVR4nFz9CZobWZKsidpwbALgTjIiM+tW9357I28hbzfvq3t(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAEAAAAAApiSv5AAAGAklEQVR4nO2d61bbSBAGW16xdt7/YW1vjLyHBYLxAtZlLt39VeU(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAEoklEQVR4nO2d63KjOhCEe1q8/xsLbdU52dpdx7GR0WVu35/YMEj(...TRUNCATED) | 1 | Breast |
fold1_00007 | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAEAAElEQVR4nHT9+3YcSdLsi+X9UgWQ7J45Z2vpRfVK+kdvpaVz9v7(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAEAAAAAApiSv5AAAGgklEQVR4nO2d7XbaOBRFhW1g0vd/1jKJHTwraTKhgL+vLF2dvX+(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAFE0lEQVR4nO2d6ZakKhCEI6N8/zeuk/ecnuVOd7kAgqZEfj9mupU(...TRUNCATED) | 1 | Breast |
fold1_00008 | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAEAAElEQVR4nOz96ZIkSZaliQlvsqiaeURk1qAbDfwAaEAE/MFL4ln(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAEAAAAAApiSv5AAAGw0lEQVR4nO2d7XbiOBAFG8LgmLz/ow4Ykmz2ZJfNMhw+bMuSWn2(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAFEElEQVR4nO2d23ajMAxFj4/y/3+sZtaaTqdpCgEbx5It7ZcQGrC(...TRUNCATED) | 1 | Breast |
fold1_00009 | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAEAAElEQVR4nOz9aZMcaZaliem+mJkDiIisqu4ZYZPC//8/+IEi/AG(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAEAAAAAApiSv5AAAGQUlEQVR4nO2d23baSBBFWyIaxSH5/w/1wFjBSmZl2azYXCR0aXV(...TRUNCATED) | "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAFDklEQVR4nO2d65qrKBBFN7v6/d+Y4XyTuXQn7V2Bgl3rTyfRKLU(...TRUNCATED) | 1 | Breast |
PanNuke in Parquet format
PanNuke contains 256 × 256 histology images with labels for individual nuclei and their cell types. This version stores all 7,901 images in Parquet files, keeping the original three folds and cell-type mapping. It is a repackaging, not an official author release.
Files and fields
There is one Parquet file per fold and one row per image. The image, inst
and type fields contain PNG bytes.
| Field | Contents |
|---|---|
id |
Unique sample name: fold1_00000, for example |
image |
RGB uint8 image encoded as PNG; pixel values are 0–255 |
inst |
uint16 instance mask encoded as PNG; 0 is background |
type |
uint8 cell-type mask encoded as PNG; labels are listed below |
fold |
Original fold number, 1, 2 or 3 |
tissue |
Original tissue category from types.npy |
Cell types
The type mask uses these labels:
| Value | Class |
|---|---|
| 0 | background |
| 1 | neoplastic |
| 2 | inflammatory |
| 3 | connective |
| 4 | dead |
| 5 | epithelial |
Instance IDs start at 1 in each image; 0 is background. IDs are unique within an image and have no meaning across images.
Original folds
Keep the original folds for comparisons with published PanNuke results. The authors specify these three arrangements:
| Arrangement | Training | Validation | Testing |
|---|---|---|---|
| 1 | Fold 1 | Fold 2 | Fold 3 |
| 2 | Fold 2 | Fold 1 | Fold 3 |
| 3 | Fold 3 | Fold 2 | Fold 1 |
Read a sample
Download a fold Parquet file, then decode one sample:
from io import BytesIO
import numpy as np
import polars as pl
from PIL import Image
def read_png(data: bytes) -> np.ndarray:
"""Read an image or label mask from PNG bytes."""
with Image.open(BytesIO(data)) as image:
return np.array(image)
row = pl.read_parquet("fold_1.parquet", n_rows=1).row(0, named=True)
image = read_png(row["image"])
instances = read_png(row["inst"])
cell_types = read_png(row["type"])
The decoded shapes are (256, 256, 3) for the RGB image and (256, 256) for
both masks. Each positive instance number identifies one nucleus; type gives
its cell category at the same pixels. The Hub configuration exposes fold1,
fold2 and fold3 as separate splits.
Plot patches and annotations
The following example shows three patches from fold 1:
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
from skimage.segmentation import find_boundaries
sample_ids = ["fold1_00017", "fold1_00738", "fold1_02422"]
samples = (
pl.scan_parquet("fold_1.parquet")
.filter(pl.col("id").is_in(sample_ids))
.collect()
)
names = ["Neoplastic", "Inflammatory", "Connective", "Dead", "Epithelial"]
colors = np.array([
[230, 75, 53], [54, 140, 204], [0, 160, 135],
[243, 155, 60], [144, 102, 190],
]) / 255
fig, axes = plt.subplots(3, 2, figsize=(5.5, 8))
for row_axes, sample in zip(axes, samples.iter_rows(named=True)):
image = read_png(sample["image"])
instances = read_png(sample["inst"])
cell_types = read_png(sample["type"])
foreground = instances > 0
overlay = image / 255
overlay[foreground] = (
0.65 * overlay[foreground] + 0.35 * colors[cell_types[foreground] - 1]
)
edges = find_boundaries(instances, mode="inner") & foreground
overlay[edges] = colors[cell_types[edges] - 1]
for ax, pixels in zip(row_axes, (image, overlay)):
ax.imshow(pixels)
ax.set_axis_off()
row_axes[0].set_title(sample["tissue"], fontsize=9)
axes[0, 1].set_title("Nucleus annotations", fontsize=9)
fig.legend(
handles=[Patch(facecolor=c, label=n) for c, n in zip(colors, names)],
loc="lower center", ncol=5, frameon=False, fontsize=7,
)
fig.tight_layout(rect=(0, 0.04, 1, 1))
plt.show()
Breast, colon and skin patches from fold 1. Left: original images. Right: annotated nuclei, coloured by cell type.
Conversion notes
Images keep their original pixel values and size. Instance IDs are renumbered within each image. A small number of pixels belong to multiple nucleus class channels in the source data; these are assigned to the lower-numbered class. Background is any pixel without a nucleus. Every original nucleus is retained.
All saved images and masks are checked against the source after conversion.
manifest.json records sample counts, conversion details and file hashes.
License and attribution
PanNuke is provided for research and noncommercial use under CC BY-NC-SA 4.0. This repackaging retains that license. Attribute the original authors, cite both papers below, link to the original data and license, and identify the format and label-conversion changes when redistributing it.
- Gamper et al. (2019). PanNuke: an open pan-cancer histology dataset for nuclei instance segmentation and classification. Paper.
- Gamper et al. (2020). PanNuke Dataset Extension, Insights and Baselines. Paper.
Validated sample counts
| Fold | Samples |
|---|---|
| 1 | 2656 |
| 2 | 2523 |
| 3 | 2722 |
Total: 7901 samples.
- Downloads last month
- -
