MaybeRichard commited on
Commit
9bb2cc7
·
verified ·
1 Parent(s): 0f1e977

Update dataset README and inventory

Browse files
Files changed (1) hide show
  1. README.md +42 -264
README.md CHANGED
@@ -1,275 +1,53 @@
1
  ---
2
- pretty_name: GenSegDataset
3
  license: other
4
- license_name: mixed-per-subset
5
  task_categories:
6
  - image-segmentation
7
- task_ids:
8
- - semantic-segmentation
9
- tags:
10
- - medical
11
- - medical-imaging
12
- - 2d-segmentation
13
- - semantic-segmentation
14
- - benchmark
15
- - multi-modality
16
- size_categories:
17
- - 10K<n<100K
18
- # NOTE: the `configs:` data_files mapping below is finalized once the on-disk
19
- # format (Parquet vs PNG mirror) is chosen; left as a template for now.
20
- # configs:
21
- # - config_name: cvc_clinicdb
22
- # data_files:
23
- # - split: train
24
- # path: cvc_clinicdb/official/train/*
25
  ---
26
 
27
- # GenSegDataset — A Unified 2D Medical Image Segmentation Benchmark
28
 
29
- **GenSegDataset** is a standardized collection of **10 public 2D medical image
30
- segmentation datasets** spanning **8 imaging modalities**, re-packaged into a single
31
- consistent layout (identical directory structure, mask encoding, split files, and
32
- metadata) so that segmentation models — and generative mask-conditioned data
33
- augmentation methods — can be trained and compared across modalities with one data
34
- pipeline.
35
 
36
- > This repository redistributes **standardized derivatives** of existing public
37
- > datasets. Each subset retains the license and citation requirements of its
38
- > original source — see [Licensing & Attribution](#licensing--attribution) and
39
- > please cite the original works.
40
 
41
- ---
42
-
43
- ## Overview
44
-
45
- | Subset | Modality | Anatomy / Target | Classes | Channels | Sample size | Protocol | Train / Val / Test |
46
- |---|---|---|---|---|---|---|---|
47
- | `cvc_clinicdb` | Colonoscopy | Polyp | 2 | RGB | 384×288 | official | 490 / 61 / 61 |
48
- | `kvasir_seg` | GI endoscopy | Polyp | 2 | RGB | ~622×529 (var) | official | 800 / 100 / 100 |
49
- | `fives` | Retinal fundus | Vessel | 2 | RGB | 2048×2048 | official | 480 / 120 / 200 |
50
- | `busi` | Breast ultrasound | Tumor | 2 | RGB | variable | 5-fold (fold01–05) | 545 / 78 / 157 (fold01) |
51
- | `refuge2` | Retinal fundus | Optic disc & cup | 3 | RGB | ~2124×2056 | official | 400 / 400 / 400 |
52
- | `acdc_png` | Cardiac MRI (2D slices) | RV / Myo / LV | 4 | grayscale | ~240×256 (var) | official | 136 / 210 / 380 |
53
- | `idridd_segmentation` | Retinal fundus | Diabetic-retinopathy lesions | 6 | RGB | 4288×2848 | 5-fold (fold01–05) | 43 / 11 / 27 (fold01) |
54
- | `pannuke_semantic` | Histopathology (H&E) | Nuclei (5 types) | 6 | RGB | 256×256 | 3-fold (fold01–03) | 2722 / 2523 / 2656 (fold01) |
55
- | `medsegdb_isic2018` | Dermoscopy | Skin lesion | 2 | RGB | 256×256 | holdout | 2582 / 369 / 737 |
56
- | `medsegdb_kits19` | Kidney CT (2D slices) | Kidney region (binary) | 2 | grayscale¹ | 256×256 | 5-fold (fold01–05) | 2832 / 479 / 705 (fold01) |
57
-
58
- ¹ `medsegdb_kits19` images are grayscale in content but stored as 3-channel PNG;
59
- read them as grayscale (`IMREAD_GRAYSCALE`) for true single-channel input.
60
-
61
- For cross-validation subsets (`busi`, `idridd_segmentation`, `medsegdb_kits19`:
62
- 5 folds; `pannuke_semantic`: 3 folds) every fold reuses the **same images** under a
63
- different train/val/test partition. `holdout` and `official` provide a single fixed
64
- partition.
65
-
66
- ---
67
-
68
- ## Directory layout
69
-
70
- Each subset is shipped as a single archive **`<subset>.tar`** at the repo root;
71
- extracting it yields the structure below.
72
-
73
- ```
74
- GenSegDataset/
75
- <subset>.tar # download & extract -> <subset>/...
76
- <subset>/ # (after extraction)
77
- metadata.json # subset-level metadata
78
- manifest.jsonl # one JSON line per image: relative image/mask paths
79
- <protocol>/ # e.g. official | fold01..fold05 | fold01..fold03 | holdout
80
- train/ val/ test/
81
- images/ # input images (.png)
82
- masks/ # segmentation masks (.png)
83
- README.md # this card
84
- ```
85
-
86
- - **Pairing**: an image and its mask share the same file stem
87
- (`images/<id>.png` ↔ `masks/<id>.png`); `manifest.jsonl` also lists the pairing
88
- explicitly with paths relative to the subset root.
89
- - **Modality / channels**: input images are RGB (3-channel) except `acdc_png`
90
- (true grayscale) and `medsegdb_kits19` (grayscale content, 3-channel container).
91
-
92
- ### Mask encoding
93
-
94
- Masks are single-channel `uint8` label maps with **values `0 … C-1`**
95
- (`0` = background), **not** 0/255. Semantic meaning per index (confirmed against each
96
- subset's `metadata.json` and the standardization scripts):
97
-
98
- | Subset | Class indices |
99
- |---|---|
100
- | `cvc_clinicdb`, `kvasir_seg` | 0 background · 1 polyp |
101
- | `fives` | 0 background · 1 vessel |
102
- | `busi` | 0 background · 1 tumor (multi-instance masks merged) |
103
- | `medsegdb_isic2018` | 0 background · 1 lesion |
104
- | `medsegdb_kits19` | 0 background · 1 foreground (kidney region, binary) |
105
- | `refuge2` | 0 background · 1 optic disc · 2 optic cup |
106
- | `acdc_png` | 0 background · 1 right ventricle · 2 myocardium · 3 left ventricle |
107
- | `idridd_segmentation` | 0 background · 1 microaneurysms · 2 haemorrhages · 3 hard exudates · 4 soft exudates · 5 optic disc |
108
- | `pannuke_semantic` | 0 background · 1 neoplastic · 2 inflammatory · 3 connective · 4 dead · 5 epithelial |
109
-
110
- ---
111
-
112
- ## Usage
113
-
114
- ### Download & extract a subset
115
-
116
- ```python
117
- from huggingface_hub import hf_hub_download
118
- import tarfile
119
-
120
- p = hf_hub_download("GenSegDataset/GenSegDataset", "cvc_clinicdb.tar", repo_type="dataset")
121
- tarfile.open(p).extractall("GenSegDataset") # -> GenSegDataset/cvc_clinicdb/...
122
- ```
123
-
124
- ### Direct file access (after extraction)
125
-
126
- ```python
127
- import cv2, glob, os
128
-
129
- root = "GenSegDataset/cvc_clinicdb/official/train"
130
- img = cv2.imread(f"{root}/images/0001.png") # RGB input
131
- msk = cv2.imread(f"{root}/masks/0001.png", cv2.IMREAD_GRAYSCALE) # label map 0..C-1
132
- ```
133
-
134
- ### With `datasets` (once the Parquet/loader build is published)
135
-
136
- ```python
137
- from datasets import load_dataset
138
- ds = load_dataset("GenSegDataset/GenSegDataset", "cvc_clinicdb") # config = subset
139
- sample = ds["train"][0] # {"image": PIL.Image, "mask": PIL.Image, ...}
140
- ```
141
-
142
- > The `datasets`-loadable build (Parquet with embedded image/mask + a config per
143
- > subset) is added on top of the raw file mirror; until then use direct file access.
144
-
145
- ---
146
-
147
- ## Standardization methodology
148
-
149
- All subsets were converted to the unified layout above with a shared pipeline:
150
-
151
- 1. **Format unification** — images/masks re-encoded to `.png`; masks remapped to a
152
- contiguous `0 … C-1` label space.
153
- 2. **Fixed, reproducible splits** — official splits used where they exist
154
- (`cvc_clinicdb`, `kvasir_seg`, `fives`, `refuge2`, `acdc_png`); otherwise fixed
155
- k-fold (`busi`, `idridd_segmentation`, `medsegdb_kits19`: 5-fold;
156
- `pannuke_semantic`: official 3-fold) or a fixed holdout (`medsegdb_isic2018`).
157
- Splits are frozen in `manifest.jsonl` so results are reproducible.
158
- 3. **Metadata** — each subset carries `metadata.json` and a per-image
159
- `manifest.jsonl`.
160
-
161
- The collection was assembled to benchmark (a) 2D segmentation backbones and
162
- (b) generative, mask-conditioned data-augmentation methods under one consistent
163
- interface.
164
-
165
- ---
166
-
167
- ## Licensing & Attribution
168
-
169
- This repository contains **standardized derivatives** of the datasets below. **Each
170
- subset is governed by its original license**; users must comply with the source
171
- terms and **cite the original publications**. Source links:
172
-
173
- | Subset | Source |
174
- |---|---|
175
- | `cvc_clinicdb` | CVC-ClinicDB (Bernal et al., 2015) |
176
- | `kvasir_seg` | Kvasir-SEG (Jha et al., 2020) |
177
- | `fives` | FIVES (Jin et al., 2022) |
178
- | `busi` | BUSI (Al-Dhabyani et al., 2020) |
179
- | `refuge2` | REFUGE / REFUGE2 (Orlando et al., 2020; Fang et al., 2022) |
180
- | `acdc_png` | ACDC (Bernard et al., 2018) |
181
- | `idridd_segmentation` | IDRiD (Porwal et al., 2018, 2020) |
182
- | `pannuke_semantic` | PanNuke (Gamper et al., 2019, 2020) |
183
- | `medsegdb_isic2018` | ISIC 2018 / HAM10000 (Codella et al., 2019; Tschandl et al., 2018) |
184
- | `medsegdb_kits19` | KiTS19 (Heller et al., 2019, 2021) |
185
-
186
- ---
187
-
188
- ## Citation
189
-
190
- If you use **GenSegDataset**, please cite this collection **and** the original
191
- source dataset(s) you use.
192
-
193
- ```bibtex
194
- @misc{gensegdataset2026,
195
- title = {GenSegDataset: A Unified 2D Medical Image Segmentation Benchmark},
196
- author = {<authors>},
197
- year = {2026},
198
- howpublished = {Hugging Face Datasets},
199
- note = {Standardized collection of 10 public 2D medical segmentation datasets}
200
- }
201
- ```
202
-
203
- <details>
204
- <summary>Original-source BibTeX (please verify before camera-ready)</summary>
205
-
206
- ```bibtex
207
- @article{bernal2015cvcclinicdb,
208
- title={WM-DOVA maps for accurate polyp highlighting in colonoscopy},
209
- author={Bernal, Jorge and S{\'a}nchez, F Javier and Fern{\'a}ndez-Esparrach, Gloria and Gil, Debora and Rodr{\'i}guez, Cristina and Vilari{\~n}o, Fernando},
210
- journal={Computerized Medical Imaging and Graphics}, volume={43}, pages={99--111}, year={2015}}
211
-
212
- @inproceedings{jha2020kvasirseg,
213
- title={Kvasir-SEG: A segmented polyp dataset},
214
- author={Jha, Debesh and Smedsrud, Pia H and Riegler, Michael A and Halvorsen, P{\aa}l and de Lange, Thomas and Johansen, Dag and Johansen, H{\aa}vard D},
215
- booktitle={MultiMedia Modeling (MMM)}, year={2020}}
216
-
217
- @article{jin2022fives,
218
- title={FIVES: A fundus image dataset for artificial intelligence based vessel segmentation},
219
- author={Jin, Kai and Huang, Xingru and Zhou, Jingxing and others},
220
- journal={Scientific Data}, volume={9}, year={2022}}
221
-
222
- @article{aldhabyani2020busi,
223
- title={Dataset of breast ultrasound images},
224
- author={Al-Dhabyani, Walid and Gomaa, Mohammed and Khaled, Hussien and Fahmy, Aly},
225
- journal={Data in Brief}, volume={28}, year={2020}}
226
-
227
- @article{orlando2020refuge,
228
- title={REFUGE Challenge: A unified framework for evaluating automated methods for glaucoma assessment from fundus photographs},
229
- author={Orlando, Jos{\'e} Ignacio and Fu, Huazhu and others},
230
- journal={Medical Image Analysis}, volume={59}, year={2020}}
231
-
232
- @article{bernard2018acdc,
233
- title={Deep learning techniques for automatic MRI cardiac multi-structures segmentation and diagnosis: Is the problem solved?},
234
- author={Bernard, Olivier and Lalande, Alain and others},
235
- journal={IEEE Transactions on Medical Imaging}, volume={37}, number={11}, year={2018}}
236
-
237
- @article{porwal2020idrid,
238
- title={IDRiD: Diabetic retinopathy -- segmentation and grading challenge},
239
- author={Porwal, Prasanna and Pachade, Samiksha and others},
240
- journal={Medical Image Analysis}, volume={59}, year={2020}}
241
-
242
- @article{gamper2020pannuke,
243
- title={PanNuke dataset extension, insights and baselines},
244
- author={Gamper, Jevgenij and Koohbanani, Navid Alemi and others},
245
- journal={arXiv:2003.10778}, year={2020}}
246
-
247
- @article{codella2019isic2018,
248
- title={Skin lesion analysis toward melanoma detection 2018: A challenge hosted by the ISIC},
249
- author={Codella, Noel and Rotemberg, Veronica and others},
250
- journal={arXiv:1902.03368}, year={2019}}
251
-
252
- @article{tschandl2018ham10000,
253
- title={The HAM10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions},
254
- author={Tschandl, Philipp and Rosendahl, Cliff and Kittler, Harald},
255
- journal={Scientific Data}, volume={5}, year={2018}}
256
-
257
- @article{heller2021kits19,
258
- title={The state of the art in kidney and kidney tumor segmentation in contrast-enhanced CT imaging: Results of the KiTS19 challenge},
259
- author={Heller, Nicholas and Isensee, Fabian and others},
260
- journal={Medical Image Analysis}, volume={67}, year={2021}}
261
  ```
262
 
263
- </details>
264
-
265
- ---
266
-
267
- ## Maintenance notes
268
-
269
- - Class indices/names above were confirmed from each subset's `metadata.json`,
270
- the actual mask label values, and the standardization scripts
271
- (`tools/process_downloaded_segmentation_datasets.py`). Most subsets' `metadata.json`
272
- omits an explicit `num_classes`/`modality` field (the two `medsegdb_*` subsets
273
- include them).
274
- - Read `acdc_png` and `medsegdb_kits19` as grayscale even though some files are
275
- stored as 3-channel containers.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
2
  license: other
 
3
  task_categories:
4
  - image-segmentation
5
+ language:
6
+ - en
7
+ pretty_name: GenSegDataset Processed Medical Segmentation Backup
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  ---
9
 
10
+ # GenSegDataset
11
 
12
+ Processed and split medical image segmentation datasets used by the SegGen/NPJ experiments.
 
 
 
 
 
13
 
14
+ Each `*.tar` expands to one dataset directory with the unified layout:
 
 
 
15
 
16
+ ```text
17
+ <dataset>/<protocol>/<split>/{images,masks}/
18
+ <dataset>/metadata.json
19
+ <dataset>/manifest.jsonl
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  ```
21
 
22
+ Splits are already prepared; archives contain extracted PNG image/mask pairs, not raw compressed source zips.
23
+
24
+ ## Inventory
25
+
26
+ | Dataset | Archive | Size on server | Total images across protocols | Protocols train/val/test |
27
+ |---|---:|---:|---:|---|
28
+ | `acdc_png` | `acdc_png.tar` | 61M | 726 | official:136/210/380 |
29
+ | `bus_bra` | `bus_bra.tar` | 171M | 1875 | official:1312/188/375 |
30
+ | `busi` | `busi.tar` | 17G | 4535 | fold01:545/78/157; fold02:545/78/157; fold03:546/78/156; fold04:547/78/155; fold05:547/78/155; synthonly:400/78/157 |
31
+ | `consep` | `consep.tar` | 88M | 656 | official:352/80/224 |
32
+ | `cvc_clinicdb` | `cvc_clinicdb.tar` | 938M | 612 | official:490/61/61 |
33
+ | `cvc_colondb` | `cvc_colondb.tar` | 50M | 380 | official:266/38/76 |
34
+ | `drive` | `drive.tar` | 1.8M | 20 | official:14/2/4 |
35
+ | `endoscene` | `endoscene.tar` | 107M | 912 | official:547/183/182 |
36
+ | `etis_larib` | `etis_larib.tar` | 30M | 196 | official:137/19/40 |
37
+ | `fives` | `fives.tar` | 311M | 800 | official:480/120/200 |
38
+ | `ham10000` | `ham10000.tar` | 1.7G | 10015 | holdout:7010/1002/2003 |
39
+ | `idridd_segmentation` | `idridd_segmentation.tar` | 3.6M | 405 | fold01:43/11/27; fold02:43/11/27; fold03:43/11/27; fold04:43/11/27; fold05:44/10/27 |
40
+ | `kvasir_seg` | `kvasir_seg.tar` | 17G | 1000 | official:800/100/100 |
41
+ | `medsegdb_isic2018` | `medsegdb_isic2018.tar` | 24G | 5194 | holdout:2582/369/737; synthonly:400/369/737 |
42
+ | `medsegdb_kits19` | `medsegdb_kits19.tar` | 1.3G | 20080 | fold01:2832/479/705; fold02:2966/231/819; fold03:3036/465/515; fold04:2854/286/876; fold05:2510/405/1101 |
43
+ | `monuseg` | `monuseg.tar` | 411M | 816 | official:496/96/224 |
44
+ | `pannuke_semantic` | `pannuke_semantic.tar` | 1.2G | 23703 | fold01:2722/2523/2656; fold02:2656/2722/2523; fold03:2523/2656/2722 |
45
+ | `ph2` | `ph2.tar` | 27M | 200 | holdout:140/20/40 |
46
+ | `refuge2` | `refuge2.tar` | 133M | 1200 | official:400/400/400 |
47
+ | `udiat` | `udiat.tar` | 17M | 163 | official:114/16/33 |
48
+
49
+ ## Notes
50
+
51
+ - The inventory file `HF_UPLOAD_INVENTORY.tsv` contains the same split/count audit in tabular form.
52
+ - Image/mask stems were checked for alignment before upload.
53
+ - Some archives are older backups; newly added archives were uploaded from `/home/wzhang/LSC/Dataset/Segmentation/processed_unified` on 2026-07-01.