MaybeRichard commited on
Commit
739b2ac
·
verified ·
1 Parent(s): 660ffe0

Update README: literature comparison + 3D versions (ACDC 3D, BraTS 2021 3D)

Browse files
Files changed (1) hide show
  1. README.md +99 -11
README.md CHANGED
@@ -18,15 +18,19 @@ tags:
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
@@ -46,10 +50,18 @@ research, not just the original study.
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/
@@ -64,6 +76,16 @@ MedSeg-7D/
64
  │ # HuggingFace's 10000 files-per-directory limit. Filenames preserve the
65
  │ # original volume_X_slice_Y.png convention.
66
 
 
 
 
 
 
 
 
 
 
 
67
  ├── BUSI/ (breast ultrasound, 780 images)
68
  │ ├── images/
69
  │ └── masks/ masks suffixed _mask.png
@@ -83,10 +105,10 @@ MedSeg-7D/
83
  │ ├── bbox/ bounding boxes (auxiliary)
84
  │ └── kavsir_seg_README.md original release notes
85
 
86
- ├── REFUGE2/ (fundus optic disc, 400 images)
87
- │ ├── train/ {images/, mask/}
88
- │ ├── val/ {images/, mask/}
89
- │ └── test/ {images/, mask/}
90
 
91
  └── ISIC2018/ (dermoscopy lesions, 2594 train + 100 val + 1000 test)
92
  ├── train/ {images/, masks/}
@@ -182,9 +204,9 @@ Approximate total size: ~18 GB.
182
  |---|---|
183
  | **Modality** | Fundus photography |
184
  | **Original task** | Optic disc and cup segmentation |
185
- | **Images** | 400 (across train/val/test as released) |
186
  | **Mask convention** | Multi-class (BG / disc / cup) preserved; for binary disc segmentation, treat any non-background pixel as foreground |
187
- | **Split type** | Pre-released train/val/test split is preserved |
188
  | **Leakage risk** | None — each image is from a different patient by protocol. |
189
  | **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. |
190
  | **Source** | [REFUGE2 Challenge](https://refuge.grand-challenge.org/) |
@@ -207,6 +229,53 @@ Approximate total size: ~18 GB.
207
 
208
  ---
209
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  ## Recommended use
211
 
212
  **For paired-comparison evaluation across methods**, lock to the canonical
@@ -236,6 +305,25 @@ info = json.load(open(os.path.join(ROOT, "CVC-ClinicDB", "video_split_seed42.jso
236
  train_seqs = set(info["train_sequences"])
237
  ```
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  For datasets without a `split_info.json`, the canonical image-level split
240
  is reproducible from `seed=42`:
241
 
 
18
  - mri
19
  ---
20
 
21
+ # MedSeg-7D: Seven Public Medical Segmentation Benchmarks (2D + 3D)
22
 
23
+ A curated bundle of seven public 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
+ For the two volumetric MRI datasets (ACDC, BraTS), this release ships
31
+ **both 2D slice extracts and the original 3D NIfTI volumes**, so users can
32
+ choose 2D or 3D pipelines without re-downloading.
33
+
34
  This is the **dataset-only release** that accompanied an evaluation-protocol
35
  audit of pixel- vs.\ latent-space diffusion augmentation for medical image
36
  segmentation. The bundle is reusable for any 2D medical-segmentation
 
50
  ```
51
  MedSeg-7D/
52
  ├── README.md
53
+ ├── ACDC/ (cardiac MRI, 100 patients)
54
+ │ ├── images/ 2D slices: patient<id>_frame<f>_slice_<s>.png
55
+ │ ├── masks/ matching 2D-slice mask filenames (any-structure binary)
56
+ │ ├── 3D/ ORIGINAL 3D NIfTI volumes (challenge layout)
57
+ │ │ ├── training/
58
+ │ │ │ ├── patient001/ Info.cfg + patient001_4d.nii.gz + frame01.nii.gz + frame01_gt.nii.gz + frame12.nii.gz + frame12_gt.nii.gz
59
+ │ │ │ └── ... (100 patients)
60
+ │ │ └── testing/ 50 held-out patients (challenge test set)
61
  │ └── split_info.json CANONICAL patient-level split (seed=42, 80/20)
62
+ │ # 2D and 3D share the same 100-patient training cohort. The 3D side
63
+ │ # additionally ships the official 50 challenge test patients, which the
64
+ │ # 2D side does NOT include (we re-split the 100 train patients 80/20).
65
 
66
  ├── BraTS2020/ (brain MRI FLAIR, 369 volumes → 22677 slices)
67
  │ ├── images/
 
76
  │ # HuggingFace's 10000 files-per-directory limit. Filenames preserve the
77
  │ # original volume_X_slice_Y.png convention.
78
 
79
+ ├── BraTS2021_3D/ (brain MRI 3D NIfTI, 1251 patients — superset of BraTS2020)
80
+ │ ├── BraTS2021_00000/ 5 NIfTI files: t1, t1ce, t2, flair, seg (4 modalities + GT)
81
+ │ ├── BraTS2021_00002/
82
+ │ └── ... (1251 patient dirs)
83
+ │ # IMPORTANT: This is BraTS *2021*, a SUPERSET of BraTS 2020. The 369
84
+ │ # volumes in our 2D `BraTS2020/` are a subset of the 1251 here. Patient
85
+ │ # IDs differ between the 2020 and 2021 releases, so split_info.json
86
+ │ # (volume-level for 2020) does NOT apply to BraTS2021_3D directly. Do
87
+ │ # not mix 2D and 3D Dice numbers.
88
+
89
  ├── BUSI/ (breast ultrasound, 780 images)
90
  │ ├── images/
91
  │ └── masks/ masks suffixed _mask.png
 
105
  │ ├── bbox/ bounding boxes (auxiliary)
106
  │ └── kavsir_seg_README.md original release notes
107
 
108
+ ├── REFUGE2/ (fundus optic disc, 1200 images = 400 train + 400 val + 400 test)
109
+ │ ├── train/ {images/, mask/} 400 images
110
+ │ ├── val/ {images/, mask/} 400 images
111
+ │ └── test/ {images/, mask/} 400 images
112
 
113
  └── ISIC2018/ (dermoscopy lesions, 2594 train + 100 val + 1000 test)
114
  ├── train/ {images/, masks/}
 
204
  |---|---|
205
  | **Modality** | Fundus photography |
206
  | **Original task** | Optic disc and cup segmentation |
207
+ | **Images** | 1200 = 400 train + 400 validation + 400 test (full official challenge release) |
208
  | **Mask convention** | Multi-class (BG / disc / cup) preserved; for binary disc segmentation, treat any non-background pixel as foreground |
209
+ | **Split type** | Pre-released **400/400/400 train/val/test** split is preserved |
210
  | **Leakage risk** | None — each image is from a different patient by protocol. |
211
  | **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. |
212
  | **Source** | [REFUGE2 Challenge](https://refuge.grand-challenge.org/) |
 
229
 
230
  ---
231
 
232
+ ## Comparison to literature and existing HuggingFace cards
233
+
234
+ We audited the most common split conventions in published segmentation papers
235
+ (MICCAI / IEEE TMI / MIA / CVPR / NeurIPS) and the two existing HuggingFace
236
+ community cards for the same datasets, then aligned our defaults where
237
+ sensible. Summary:
238
+
239
+ | Dataset | Mainstream literature default | HuggingFace community card | **Our default** | Verdict |
240
+ |---|---|---|---|---|
241
+ | CVC-ClinicDB | Image-level via PraNet's release files (550 train + 62 test pooled with Kvasir into 1450/100) | `Angelou0516/CVC-ClinicDB`: 80/10/10 image-level, ESFPNet split | Image-level 80/20 seed=42; **also a video-level 23/6-sequence split** is shipped | Matches PraNet practice; we additionally fix the same-video leakage that PraNet's image split exposes |
242
+ | Kvasir-SEG | Image-level via PraNet's 900/100 release files | `kowndinya23/Kvasir-SEG`: 880/120 (no test) | Image-level 80/20 seed=42 | Close to mainstream; if you need PraNet-comparable numbers, use 900/100 instead |
243
+ | BUSI | Image-level random; growing minority does 5-fold + de-duplication (BUS-Set, Med Phys 2023, documents duplicate leakage) | n/a | Image-level 80/20 seed=42 | Matches majority; **flag**: BUSI release has documented duplicates, and patient IDs are not public, so true patient-level splits are not possible |
244
+ | ISIC 2018 | Official 2594/100/1000 OR pooled 80/20 | varies | Official 2594/100/1000 preserved | Matches official challenge split |
245
+ | REFUGE2 | Official 400/400/400 (train/val/test domain-shift design) | varies | Official train/val/test preserved | Matches official |
246
+ | ACDC | Patient-level; TransUNet 70/10/20 of the 100 train OR nnU-Net 5-fold patient CV | rarely correct on HF | Patient-level 80/20 seed=42 (in `split_info.json`); 3D side **also** ships official 100-train + 50-test challenge layout | Stricter than the careless cards; consistent with TransUNet/nnU-Net practice |
247
+ | BraTS 2020 | Volume-level; nnU-Net 5-fold patient CV is the most-cited recipe | rarely correct on HF | Volume-level 80/20 seed=42 (295/74) | Matches the careful camp; nnU-Net's 5-fold is a reasonable alternative on the same volumes |
248
+
249
+ **Mainstream papers we cross-checked**: PraNet (Fan et al., MICCAI 2020),
250
+ Polyp-PVT (Dong et al., 2021), ESFPNet (Chang et al., 2024), BUS-Set
251
+ (Thomas et al., Med Phys 2023), TransUNet (Chen et al., 2021), SwinUNet
252
+ (Cao et al., 2022), nnU-Net (Isensee et al., Nat. Methods 2021).
253
+
254
+ ### Notable disagreements with HuggingFace community cards
255
+
256
+ - `kowndinya23/Kvasir-SEG` (880/120) merges the test fold into validation,
257
+ making it **non-comparable to PraNet's 900/100**. Ours preserves
258
+ test/val separation.
259
+ - `Angelou0516/CVC-ClinicDB` does image-level 80/10/10 without flagging
260
+ the same-video frame leakage that affects all 3 splits. We add an
261
+ explicit video-level split for leakage-free evaluation.
262
+ - Neither HuggingFace card we found exposes patient-level splits for
263
+ ACDC or BraTS — we provide them via `split_info.json`.
264
+
265
+ ### When to *not* use our defaults
266
+
267
+ - If you must **directly compare to PraNet/Polyp-PVT** numbers, use their
268
+ released 1450/test files (not in this bundle, but reproducible from the
269
+ raw images here).
270
+ - If you need **nnU-Net 5-fold CV** on ACDC or BraTS, regenerate folds
271
+ with the standard nnU-Net recipe — our 80/20 split is a single-fold
272
+ approximation.
273
+ - If you need **BraTS 2021 (1251 volumes)** instead of 2020 (369), the
274
+ 3D version is shipped under `BraTS2021_3D/` (subset of 2020 patients
275
+ is included; new 2021-specific patients are added).
276
+
277
+ ---
278
+
279
  ## Recommended use
280
 
281
  **For paired-comparison evaluation across methods**, lock to the canonical
 
305
  train_seqs = set(info["train_sequences"])
306
  ```
307
 
308
+ For the **3D NIfTI versions**:
309
+
310
+ ```python
311
+ import nibabel as nib
312
+ import os
313
+
314
+ # ACDC 3D (original challenge layout, 100 train + 50 test patients)
315
+ patient_dir = os.path.join(ROOT, "ACDC", "3D", "training", "patient001")
316
+ img = nib.load(os.path.join(patient_dir, "patient001_frame01.nii.gz")).get_fdata()
317
+ gt = nib.load(os.path.join(patient_dir, "patient001_frame01_gt.nii.gz")).get_fdata()
318
+ # img shape: (H, W, num_short_axis_slices); gt has 4 classes (0=BG, 1=RV, 2=Myo, 3=LV)
319
+
320
+ # BraTS 2021 3D (1251 patients, 4 modalities + GT each)
321
+ pat = os.path.join(ROOT, "BraTS2021_3D", "BraTS2021_00000")
322
+ flair = nib.load(os.path.join(pat, "BraTS2021_00000_flair.nii.gz")).get_fdata()
323
+ seg = nib.load(os.path.join(pat, "BraTS2021_00000_seg.nii.gz")).get_fdata()
324
+ # seg has 4 classes (0=BG, 1=necrotic, 2=edema, 4=enhancing); whole-tumor = (seg > 0)
325
+ ```
326
+
327
  For datasets without a `split_info.json`, the canonical image-level split
328
  is reproducible from `seed=42`:
329