ogutsevda commited on
Commit
4dfbcae
·
verified ·
1 Parent(s): b683d30

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +140 -3
README.md CHANGED
@@ -1,3 +1,140 @@
1
- ---
2
- license: cc-by-nc-sa-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-sa-4.0
3
+ task_categories:
4
+ - graph-ml
5
+ tags:
6
+ - histopathology
7
+ - node-classification
8
+ - breast-cancer
9
+ - pytorch-geometric
10
+ pretty_name: Graph-NuCLS
11
+ size_categories:
12
+ - 1K<n<10K
13
+ ---
14
+
15
+ # Graph-NuCLS: A Cell-Graph Dataset for Nucleus Classification from NuCLS
16
+
17
+ <p align="center">
18
+ <img src="animation.gif" alt="Graph-NuCLS teaser – cell-graph construction from a histopathology patch" width="600"/>
19
+ </p>
20
+
21
+ **Graph-NuCLS** is a node-level classification dataset derived from the [NuCLS](https://sites.google.com/view/nucls/home) dataset with "main" labels. 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 7 classes. Note that node features describe cell morphology, texture, and color intensity whereas edge features are Euclidean distance in micrometers.
22
+
23
+ This dataset is part of the paper **GrapHist: Graph Self-Supervised Learning for Histopathology**.
24
+
25
+ > ⚠️ **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.
26
+
27
+ ## Dataset Summary
28
+
29
+ | Property | Value |
30
+ |---|---|
31
+ | **# Patches** | 1,694 |
32
+ | **Avg # Nodes** | 30.76 |
33
+ | **Avg # Edges** | 78.62 |
34
+ | **# Classes** | 7 |
35
+
36
+
37
+ ## Node Classes
38
+
39
+ | Label ID | Class Name |
40
+ |---|---|
41
+ | 0 | Lymphocyte |
42
+ | 1 | Macrophage |
43
+ | 2 | Non-TIL / Non-MQ Stromal |
44
+ | 3 | Other Nucleus |
45
+ | 4 | Plasma Cell |
46
+ | 5 | Tumor (Mitotic) |
47
+ | 6 | Tumor (Non-Mitotic) |
48
+
49
+ ## Data Structure
50
+
51
+ ```
52
+ graph-nucls/
53
+ ├── README.md
54
+ ├── animation.gif
55
+ ├── data/
56
+ │ ├── {SLIDE_ID}_id-5ea4...left-11371_top-54469_bottom-54761_right-11671.pt
57
+ │ └── ... # 1,694 .pt files
58
+ └── splits/
59
+ ├── fold_1_train.csv
60
+ ├── fold_1_test.csv
61
+ ├── ...
62
+ └── fold_5_test.csv
63
+ ```
64
+
65
+ Each `.pt` file is a PyTorch Geometric `Data` object with the following attributes:
66
+
67
+ | Attribute | Shape | Description |
68
+ |---|---|---|
69
+ | `x` | `[num_nodes, 96]` | Node feature matrix |
70
+ | `edge_index` | `[2, num_edges]` | Graph connectivity in COO format |
71
+ | `edge_attr` | `[num_edges, 1]` | Edge features |
72
+ | `labels` | `[num_nodes]` | Per-node class label |
73
+ | `sample_id` | `str` | Unique patch identifier |
74
+
75
+ ### `splits/fold_N_{train|test}.csv`
76
+
77
+ Each fold CSV maps slides to their hospital and split assignment:
78
+
79
+ ```
80
+ slide_name,hospital,type,fold
81
+ TCGA-E2-A14N-DX1,E2,train,1
82
+ TCGA-C8-A131-DX1,C8,train,1
83
+ ...
84
+ ```
85
+
86
+ To assign graph files to a fold split, match the `SLIDE_ID` prefix in the filename against the `slide_name` column.
87
+
88
+ ---
89
+
90
+ ## Quick Start
91
+
92
+ ```python
93
+ import torch
94
+ from torch_geometric.data import Data
95
+
96
+ # Load a single graph
97
+ graph = torch.load("data/TCGA-A1-A0SP-DX1_id-5ea4095addda5f8398977ebc_left-11371_top-54469_bottom-54761_right-11671.pt", weights_only=False)
98
+
99
+ print(graph)
100
+ # Data(x=[26, 96], edge_index=[2, 63], edge_attr=[63, 1], sample_id='...', labels=[26])
101
+
102
+ print(f"Nodes: {graph.x.shape[0]}, Edges: {graph.edge_index.shape[1]}")
103
+ print(f"Node labels: {graph.labels}")
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Citation
109
+
110
+ If you use this dataset, please cite both our work, and the original NuCLS dataset:
111
+
112
+ **GrapHist (this dataset):**
113
+ ```bibtex
114
+ @article{graphist2025,
115
+ title = {GrapHist: Graph Self-Supervised Learning for Histopathology},
116
+ author = {TODO},
117
+ journal = {TODO},
118
+ year = {TODO},
119
+ note = {TODO: add full citation}
120
+ }
121
+ ```
122
+
123
+ **NuCLS (source annotations):**
124
+ ```bibtex
125
+ @article{amgad2022nucls,
126
+ title={NuCLS: A scalable crowdsourcing approach and dataset for nucleus classification and segmentation in breast cancer},
127
+ author={Amgad, Mohamed and Atteya, Lamees A and Hussein, Hagar and Mohammed, Kareem Hosny and Hafiz, Ehab and Elsebaie, Maha AT and Alhusseiny, Ahmed M and AlMoslemany, Mohamed Atef and Elmatboly, Abdelmagid M and Pappalardo, Philip A and others},
128
+ journal={GigaScience},
129
+ volume={11},
130
+ pages={giac037},
131
+ year={2022},
132
+ publisher={Oxford University Press}
133
+ }
134
+ ```
135
+
136
+ ---
137
+
138
+ ## License
139
+
140
+ This dataset is released under the [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) license.