graph-breakhis / README.md
ogutsevda's picture
Update README.md
6b016c0 verified
metadata
license: cc-by-nc-sa-4.0
task_categories:
  - graph-ml
tags:
  - histopathology
  - graph-classification
  - breast-cancer
  - pytorch-geometric
pretty_name: Graph-BreakHis
size_categories:
  - n<1K

Graph-BreakHis: A Cell-Graph Dataset for Breast Cancer from BreakHis

Graph-BreakHis teaser – cell-graph construction from a histopathology image

Graph-BreakHis is a graph-level classification dataset derived from the BreakHis (Breast Cancer Histopathological Image Classification) dataset. Each microscopy image is converted into a cell-graph where nodes represent detected cell nuclei and edges encode spatial proximity, enabling graph-based binary classification of benign vs. malignant breast tumours. 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
Total graphs 522
Classes 2
Train / Test split 417 / 105
Node feature dim 96
Edge feature dim 1

Classes

Label Full Name Count
B Benign 233
M Malignant 289

Data Structure

graph-breakhis/
├── README.md
├── metadata.csv                                  # sample_id, label, split, graph_path
├── animation.gif                                 
└── data/
    ├── SOB_B_A-14-22549AB-40-001.pt
    ├── SOB_M_DC-14-12312-40-012.pt
    └── ...                                       

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
label str Class label
sample_id str Unique sample identifier

metadata.csv

A CSV file mapping each sample to its label, train/test split, and file path:

sample_id,label,split,graph_path
SOB_B_A-14-22549AB-40-001,B,train,graph-breakhis/data/SOB_B_A-14-22549AB-40-001.pt
SOB_B_A-14-22549AB-40-006,B,train,graph-breakhis/data/SOB_B_A-14-22549AB-40-006.pt
...

Quick Start

import torch
from torch_geometric.data import Data

# Load a single graph
graph = torch.load("data/SOB_B_A-14-22549AB-40-001.pt", weights_only=False)

print(graph)
# Data(x=[26, 96], edge_index=[2, 61], edge_attr=[61, 1], label='B', sample_id='SOB_B_A-14-22549AB-40-001')

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

Citation

If you use this dataset, please cite both our work, and the original BreakHis 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}, 
}

BreakHis (source images):

@article{spanhol2015dataset,
  title={A dataset for breast cancer histopathological image classification},
  author={Spanhol, Fabio A and Oliveira, Luiz S and Petitjean, Caroline and Heutte, Laurent},
  journal   = {IEEE Transactions on Biomedical Engineering},
  volume    = {63},
  number    = {7},
  pages     = {1455--1462},
  year={2015},
  publisher={IEEE}
}

License

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