MaybeRichard commited on
Commit
cb7b6e9
·
verified ·
1 Parent(s): 09e9bf4

Initial datacard

Browse files
Files changed (1) hide show
  1. README.md +291 -0
README.md ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ language:
4
+ - en
5
+ pretty_name: MedSeg-7D
6
+ size_categories:
7
+ - 10K<n<100K
8
+ task_categories:
9
+ - image-segmentation
10
+ tags:
11
+ - medical-imaging
12
+ - segmentation
13
+ - diffusion-augmentation
14
+ - endoscopy
15
+ - dermoscopy
16
+ - ultrasound
17
+ - fundus
18
+ - mri
19
+ ---
20
+
21
+ # MedSeg-7D: Seven Public 2D Medical Segmentation Benchmarks (with Canonical Splits)
22
+
23
+ A curated bundle of seven public 2D medical segmentation datasets, packaged
24
+ with **canonical leakage-free splits** for the four datasets where one is
25
+ needed (ACDC patient-level, BraTS2020 volume-level, CVC-ClinicDB
26
+ video-level, plus seed-fixed image-level for the rest). All raw images and
27
+ masks are retained at their original resolution; no resizing, no
28
+ preprocessing baked in.
29
+
30
+ This is the **dataset-only release** that accompanied an evaluation-protocol
31
+ audit of pixel- vs.\ latent-space diffusion augmentation for medical image
32
+ segmentation. The bundle is reusable for any 2D medical-segmentation
33
+ research, not just the original study.
34
+
35
+ > **Why this exists.** Many existing medical-augmentation papers report
36
+ > non-comparable numbers because each uses a different (often undocumented)
37
+ > train/test split, and several datasets have hidden leakage if split at
38
+ > the image level (CVC same-video frames, ACDC same-patient slices, BraTS
39
+ > same-volume slices). This release fixes one canonical split per dataset
40
+ > so future work can be paired-comparable.
41
+
42
+ ---
43
+
44
+ ## Contents
45
+
46
+ ```
47
+ MedSeg-7D/
48
+ ├── README.md
49
+ ├── ACDC/ (cardiac MRI, 100 patients → 1841 slices)
50
+ │ ├── images/ patient<id>_frame<f>_slice_<s>.png
51
+ │ ├── masks/ matching mask filenames
52
+ │ └── split_info.json CANONICAL patient-level split (seed=42, 80/20)
53
+
54
+ ├── BraTS2020/ (brain MRI FLAIR, 369 volumes → 22677 slices)
55
+ │ ├── images/ volume_<id>_slice_<s>.png (FLAIR channel)
56
+ │ ├── masks/ matching whole-tumor binary mask
57
+ │ └── split_info.json CANONICAL volume-level split (seed=42, 295/74)
58
+
59
+ ├── BUSI/ (breast ultrasound, 780 images)
60
+ │ ├── images/
61
+ │ └── masks/ masks suffixed _mask.png
62
+
63
+ ├── CVC-ClinicDB/ (endoscopy polyp, 612 frames / 29 video sequences)
64
+ │ ├── PNG/
65
+ │ │ ├── Original/ RGB frames
66
+ │ │ └── Ground Truth/ binary masks
67
+ │ ├── TIF/ original release format
68
+ │ ├── metadata.csv per-frame metadata
69
+ │ ├── class_dict.csv
70
+ │ └── video_split_seed42.json CANONICAL video-level split (23 train / 6 test sequences)
71
+
72
+ ├── Kvasir-SEG/ (endoscopy polyp, 1000 images)
73
+ │ ├── images/ RGB frames
74
+ │ ├── masks/ binary masks
75
+ │ ├── bbox/ bounding boxes (auxiliary)
76
+ │ └── kavsir_seg_README.md original release notes
77
+
78
+ ├── REFUGE2/ (fundus optic disc, 400 images)
79
+ │ ├── train/ {images/, mask/}
80
+ │ ├── val/ {images/, mask/}
81
+ │ └── test/ {images/, mask/}
82
+
83
+ └── ISIC2018/ (dermoscopy lesions, 2594 train + 100 val + 1000 test)
84
+ ├── train/ {images/, masks/}
85
+ ├── validation/ {images/, masks/}
86
+ └── test/ {images/, masks/}
87
+ ```
88
+
89
+ Approximate total size: ~18 GB.
90
+
91
+ ---
92
+
93
+ ## Per-dataset details
94
+
95
+ ### 1. ACDC — Cardiac cine-MRI
96
+
97
+ | | |
98
+ |---|---|
99
+ | **Modality** | Cardiac cine-MRI (2D slices) |
100
+ | **Original task** | Multi-class cardiac structure segmentation |
101
+ | **Patients / slices** | 100 / 1841 |
102
+ | **Mask classes** | 4 (background, RV, myocardium, LV) — preserved as in the original release |
103
+ | **Split type (canonical)** | **Patient-level**, 80 train / 20 test, seed=42 |
104
+ | **Split file** | `ACDC/split_info.json` |
105
+ | **Leakage risk** | None at patient level. Slice-level random split would leak adjacent slices and inflate Dice ~5 points. |
106
+ | **Source** | [ACDC Challenge (MICCAI 2017)](https://www.creatis.insa-lyon.fr/Challenge/acdc/) |
107
+ | **Reference** | Bernard et al., *IEEE TMI 2018* |
108
+ | **License** | Original ACDC license; please refer to the original challenge website. |
109
+
110
+ ### 2. BraTS 2020 — Brain tumor MRI (FLAIR slices)
111
+
112
+ | | |
113
+ |---|---|
114
+ | **Modality** | Brain MRI, FLAIR channel |
115
+ | **Original task** | Multi-class tumor segmentation |
116
+ | **Volumes / slices** | 369 / 22677 (this release: FLAIR-only 2D slices) |
117
+ | **Mask convention here** | Whole-tumor binary (label 1+2+4 → 1) |
118
+ | **Split type (canonical)** | **Volume-level**, 295 train / 74 test, seed=42 |
119
+ | **Split file** | `BraTS2020/split_info.json` |
120
+ | **Leakage risk** | None at volume level. Slice-level random would leak adjacent slices ~5 Dice points. |
121
+ | **Note** | Only the FLAIR modality is included. The original BraTS release has T1/T1ce/T2 in addition. If you need multi-modal data, fetch the original release. |
122
+ | **Source** | [BraTS 2020 Challenge](https://www.med.upenn.edu/cbica/brats2020/) |
123
+ | **Reference** | Menze et al., *IEEE TMI 2015*; Bakas et al., 2017 |
124
+ | **License** | Original BraTS license; please refer to the challenge website. |
125
+
126
+ ### 3. BUSI — Breast ultrasound
127
+
128
+ | | |
129
+ |---|---|
130
+ | **Modality** | B-mode breast ultrasound |
131
+ | **Original task** | Lesion segmentation (benign / malignant / normal classes are also available) |
132
+ | **Images** | 780 |
133
+ | **Mask convention** | Binary foreground; mask filenames carry `_mask.png` suffix |
134
+ | **Split type (canonical)** | Image-level, 80/20, seed=42 |
135
+ | **Leakage risk** | ⚠️ The release does **not** publish patient IDs. Multiple images may come from the same patient. The image-level split is the community standard; "patient-level" cannot be verified from the release. |
136
+ | **Source** | [BUSI Dataset (Cairo University)](https://scholar.cu.edu.eg/?q=afahmy/pages/dataset) |
137
+ | **Reference** | Al-Dhabyani et al., *Data in Brief 2020* |
138
+ | **License** | CC-BY-4.0 |
139
+
140
+ ### 4. CVC-ClinicDB — Colonoscopy polyp
141
+
142
+ | | |
143
+ |---|---|
144
+ | **Modality** | Colonoscopy (RGB endoscopy) |
145
+ | **Original task** | Polyp segmentation |
146
+ | **Frames / video sequences** | 612 / 29 |
147
+ | **Mask convention** | Binary polyp foreground |
148
+ | **Split type (canonical)** | **Video-level**, 23 train / 6 test sequences, seed=42 (489 frames train, 123 frames test) |
149
+ | **Split file** | `CVC-ClinicDB/video_split_seed42.json` |
150
+ | **Image-level split** | Available *for backward compatibility with prior literature*, but **leaks same-video frames** across train/test — can inflate Dice ~20–24 points. Image-level is the convention in many older papers; if you must reproduce them, use their split, but understand it is leaky. |
151
+ | **Recommendation** | New work should use the video-level split. |
152
+ | **Source** | [CVC-ClinicDB](https://polyp.grand-challenge.org/CVCClinicDB/) |
153
+ | **Reference** | Bernal et al., *Computerized Medical Imaging and Graphics 2015* |
154
+ | **License** | Released for academic use; cite the original paper. |
155
+
156
+ ### 5. Kvasir-SEG — Colonoscopy polyp
157
+
158
+ | | |
159
+ |---|---|
160
+ | **Modality** | Colonoscopy (RGB endoscopy) |
161
+ | **Original task** | Polyp segmentation |
162
+ | **Images** | 1000 |
163
+ | **Mask convention** | Binary polyp foreground |
164
+ | **Split type (canonical)** | Image-level, 80/20, seed=42 |
165
+ | **Leakage risk** | The release does not publish per-procedure metadata. Image-level is the community standard. |
166
+ | **Note** | Auxiliary `bbox/` (bounding boxes) included from the original release. |
167
+ | **Source** | [Kvasir-SEG](https://datasets.simula.no/kvasir-seg/) |
168
+ | **Reference** | Jha et al., *MMM 2020* |
169
+ | **License** | CC-BY-4.0 |
170
+
171
+ ### 6. REFUGE2 — Fundus optic disc
172
+
173
+ | | |
174
+ |---|---|
175
+ | **Modality** | Fundus photography |
176
+ | **Original task** | Optic disc and cup segmentation |
177
+ | **Images** | 400 (across train/val/test as released) |
178
+ | **Mask convention** | Multi-class (BG / disc / cup) preserved; for binary disc segmentation, treat any non-background pixel as foreground |
179
+ | **Split type** | Pre-released train/val/test split is preserved |
180
+ | **Leakage risk** | None — each image is from a different patient by protocol. |
181
+ | **Caveat** | Modern segmenters reach ≥99.9 Dice on optic-disc segmentation; this dataset is **saturated** for that task. Use only when you specifically need fundus / glaucoma data. |
182
+ | **Source** | [REFUGE2 Challenge](https://refuge.grand-challenge.org/) |
183
+ | **Reference** | Orlando et al., *Medical Image Analysis 2020*; Fang et al., *Medical Image Analysis 2022* |
184
+ | **License** | Original REFUGE2 license; please refer to the challenge website. |
185
+
186
+ ### 7. ISIC 2018 — Dermoscopy
187
+
188
+ | | |
189
+ |---|---|
190
+ | **Modality** | Dermoscopy |
191
+ | **Original task** | Skin lesion segmentation (Task 1) |
192
+ | **Images** | 2594 train + 100 val + 1000 test (this release: PNG-extracted from the original ISIC 2018 archive) |
193
+ | **Mask convention** | Binary lesion foreground (any-pixel > 0 → 1) |
194
+ | **Split type** | Pre-released train/validation/test split is preserved |
195
+ | **Leakage risk** | The release does not publish patient IDs. Multiple lesions per patient are possible but cross-lesion contamination is generally considered low risk. |
196
+ | **Source** | [ISIC 2018 Challenge](https://challenge.isic-archive.com/landing/2018) |
197
+ | **Reference** | Codella et al., 2019; Tschandl et al., *Sci. Data 2018* |
198
+ | **License** | CC-BY-NC-4.0 (HAM10000-derived images) |
199
+
200
+ ---
201
+
202
+ ## Recommended use
203
+
204
+ **For paired-comparison evaluation across methods**, lock to the canonical
205
+ splits in this release:
206
+
207
+ ```python
208
+ import json, os
209
+ from huggingface_hub import snapshot_download
210
+
211
+ ROOT = snapshot_download("MaybeRichard/MedSeg-7D", repo_type="dataset")
212
+
213
+ # ACDC (patient-level)
214
+ info = json.load(open(os.path.join(ROOT, "ACDC", "split_info.json")))
215
+ train_patients = set(info["train_patients"])
216
+ # enumerate slices, check patient ID in filename to assign train/test
217
+
218
+ # BraTS (volume-level) — same pattern
219
+ info = json.load(open(os.path.join(ROOT, "BraTS2020", "split_info.json")))
220
+ train_volumes = set(info["train_patients"]) # key name retained from original
221
+
222
+ # CVC (video-level — recommended) or image-level (legacy)
223
+ info = json.load(open(os.path.join(ROOT, "CVC-ClinicDB", "video_split_seed42.json")))
224
+ train_seqs = set(info["train_sequences"])
225
+ ```
226
+
227
+ For datasets without a `split_info.json`, the canonical image-level split
228
+ is reproducible from `seed=42`:
229
+
230
+ ```python
231
+ import numpy as np
232
+ def get_image_level_split(n_images, seed=42, train_ratio=0.8):
233
+ perm = np.random.RandomState(seed).permutation(n_images)
234
+ n_train = int(n_images * train_ratio)
235
+ return perm[:n_train], perm[n_train:]
236
+ ```
237
+
238
+ ---
239
+
240
+ ## Known caveats and good practices
241
+
242
+ 1. **Never use slice-level random split for ACDC or BraTS.** Same-patient
243
+ adjacent slices end up on both sides and inflate Dice ~5 points.
244
+ Always read `split_info.json`.
245
+
246
+ 2. **CVC image-level split is leaky.** Same-video frames cross train/test.
247
+ Use the video-level split (`video_split_seed42.json`) for clean
248
+ evaluation. Use image-level only for direct comparison to legacy
249
+ literature, and label such results as "leakage-audited / auxiliary".
250
+
251
+ 3. **BUSI / Kvasir / ISIC do not provide patient IDs.** Image-level random
252
+ is the de-facto community standard; do not claim "patient-level
253
+ independent" — there is no metadata to verify it.
254
+
255
+ 4. **REFUGE2 saturates at ~99.9 Dice.** Don't use it as a downstream
256
+ evaluator for augmentation studies; use it only when you need a
257
+ fundus / optic-disc task specifically.
258
+
259
+ 5. **Mask conventions vary across datasets.** Some are multi-class
260
+ (ACDC: 4 classes; BraTS original: 4 classes; REFUGE2: 3 classes).
261
+ For binary segmentation, use `mask > 0`. The released masks here
262
+ keep the original multi-class labels where applicable (no
263
+ information lost), so users can choose to binarize as needed.
264
+
265
+ 6. **All images and masks are at original resolution.** No
266
+ pre-processing baked in; you can resize per your protocol.
267
+
268
+ ---
269
+
270
+ ## Citation
271
+
272
+ If this release is useful, please cite both the original dataset papers
273
+ (see per-dataset references above) and the evaluation-protocol audit that
274
+ produced these canonical splits:
275
+
276
+ ```bibtex
277
+ @inproceedings{medseg7d2026,
278
+ title = {An Evaluation-Protocol Audit of Pixel- vs.\ Latent-Space Diffusion
279
+ Augmentation for Medical Image Segmentation},
280
+ author = {Anonymous},
281
+ booktitle = {NeurIPS 2026 (E\&D Track)},
282
+ year = {2026}
283
+ }
284
+ ```
285
+
286
+ ## License
287
+
288
+ This release does **not** redistribute datasets that are not already
289
+ publicly available. Each dataset retains its original license; consult
290
+ each per-dataset section above. The split metadata files
291
+ (`split_info.json`, `video_split_seed42.json`) are released under MIT.