graph-pannuke / README.md
ogutsevda's picture
Update README.md
a0fb42b verified
metadata
license: cc-by-nc-sa-4.0
task_categories:
  - graph-ml
tags:
  - histopathology
  - node-classification
  - pytorch-geometric
pretty_name: Graph-PanNuke
size_categories:
  - 1K<n<10K

Graph-PanNuke: A Cell-Graph Dataset for Nucleus Classification from PanNuke

Graph-PanNuke teaser – cell-graph construction from a histopathology patch

Graph-PanNuke is a node-level classification dataset derived from the PanNuke pan-cancer histology dataset. We use all slides at 40× magnification. Each tissue patch is converted into a cell-graph where nodes represent detected cell nuclei and edges encode spatial proximity. The task is predicting the cell type of each nucleus across 5 classes. Note that node features describe cell morphology, texture, and color intensity whereas edge features are Euclidean distance in micrometers.

This dataset is part of the paper GrapHist: Graph Self-Supervised Learning for Histopathology.

⚠️ Edge Weight Note: While the architecture in GrapHist supports both positive and negative edge weights, by default edge features represent Euclidean distances—meaning farther nodes have larger, positive values. This can be counterintuitive for many graph neural network models. We recommend experimenting with edge weights, such as using their inverse (e.g., 1/distance) or negative distance (e.g., -distance), to better capture proximity and benefit learning.

Dataset Summary

Property Value
# Patches 7,208
Avg # Nodes 22.66
Avg # Edges 57.16
# Classes 5

Node Classes

Label ID Class Name
0 Neoplastic
1 Inflammatory
2 Connective
3 Dead
4 Epithelial

Data Structure

graph-pannuke/
├── README.md
├── animation.gif
└── data/
    ├── fold_1/
    │   ├── Bile-duct_1_01455.pt
    │   ├── Breast_3_00420.pt
    │   └── ...
    ├── fold_2/
    │   └── ...
    └── fold_3/
        └── ...

Each .pt file is a PyTorch Geometric Data object with the following attributes:

Attribute Shape Description
x [num_nodes, 96] Node feature matrix
edge_index [2, num_edges] Graph connectivity in COO format
edge_attr [num_edges, 1] Edge features
labels [num_nodes] Per-node class label
sample_id str Unique patch identifier

Quick Start

import torch

# Load a single graph
graph = torch.load("data/fold_1/Bile-duct_1_01455.pt", weights_only=False)

print(graph)
# Data(x=[23, 96], edge_index=[2, 61], edge_attr=[61, 1], sample_id='...', labels=[23])

print(f"Nodes: {graph.x.shape[0]}, Edges: {graph.edge_index.shape[1]}")
print(f"Node labels: {graph.labels}")

Citation

If you use this dataset, please cite both our work, and the original PanNuke dataset:

GrapHist (this dataset):

@misc{ogut2026graphist,
    title={GrapHist: Graph Self-Supervised Learning for Histopathology}, 
    author={Sevda Öğüt and Cédric Vincent-Cuaz and Natalia Dubljevic and Carlos Hurtado and Vaishnavi Subramanian and Pascal Frossard and Dorina Thanou},
    year={2026},
    eprint={2603.00143},
    url={https://arxiv.org/abs/2603.00143}, 
}

PanNuke (source annotations):

@article{gamper2020pannuke,
  title={Pannuke dataset extension, insights and baselines},
  author={Gamper, Jevgenij and Koohbanani, Navid Alemi and Benes, Ksenija and Graham, Simon and Jahanifar, Mostafa and Khurram, Syed Ali and Azam, Ayesha and Hewitt, Katherine and Rajpoot, Nasir},
  journal={arXiv preprint arXiv:2003.10778},
  year={2020}
}

License

This dataset is released under the CC BY-NC-SA 4.0 license.