MaybeRichard commited on
Commit
7da79a9
·
verified ·
1 Parent(s): 6c88d32

Adopt PraNet 900/100 (Kvasir) and 550/62 (CVC) as canonical splits

Browse files
Files changed (1) hide show
  1. README.md +30 -13
README.md CHANGED
@@ -97,12 +97,14 @@ MedSeg-7D/
97
  │ ├── TIF/ original release format
98
  │ ├── metadata.csv per-frame metadata
99
  │ ├── class_dict.csv
100
- ── video_split_seed42.json CANONICAL video-level split (23 train / 6 test sequences)
 
101
 
102
  ├── Kvasir-SEG/ (endoscopy polyp, 1000 images)
103
  │ ├── images/ RGB frames
104
  │ ├── masks/ binary masks
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)
@@ -175,10 +177,11 @@ Approximate total size: ~18 GB.
175
  | **Original task** | Polyp segmentation |
176
  | **Frames / video sequences** | 612 / 29 |
177
  | **Mask convention** | Binary polyp foreground |
178
- | **Split type (canonical)** | **Video-level**, 23 train / 6 test sequences, seed=42 (489 frames train, 123 frames test) |
179
- | **Split file** | `CVC-ClinicDB/video_split_seed42.json` |
180
- | **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. |
181
- | **Recommendation** | New work should use the video-level split. |
 
182
  | **Source** | [CVC-ClinicDB](https://polyp.grand-challenge.org/CVCClinicDB/) |
183
  | **Reference** | Bernal et al., *Computerized Medical Imaging and Graphics 2015* |
184
  | **License** | Released for academic use; cite the original paper. |
@@ -191,9 +194,10 @@ Approximate total size: ~18 GB.
191
  | **Original task** | Polyp segmentation |
192
  | **Images** | 1000 |
193
  | **Mask convention** | Binary polyp foreground |
194
- | **Split type (canonical)** | Image-level, 80/20, seed=42 |
195
- | **Leakage risk** | The release does not publish per-procedure metadata. Image-level is the community standard. |
196
- | **Note** | Auxiliary `bbox/` (bounding boxes) included from the original release. |
 
197
  | **Source** | [Kvasir-SEG](https://datasets.simula.no/kvasir-seg/) |
198
  | **Reference** | Jha et al., *MMM 2020* |
199
  | **License** | CC-BY-4.0 |
@@ -238,8 +242,8 @@ 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 |
@@ -300,7 +304,17 @@ train_volumes = set(info["train_patients"]) # key name retained from original
300
  # for img_path in glob.glob(f"{ROOT}/BraTS2020/images/{vol}/*.png"):
301
  # ...
302
 
303
- # CVC (video-level recommended) or image-level (legacy)
 
 
 
 
 
 
 
 
 
 
304
  info = json.load(open(os.path.join(ROOT, "CVC-ClinicDB", "video_split_seed42.json")))
305
  train_seqs = set(info["train_sequences"])
306
  ```
@@ -324,8 +338,8 @@ 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
 
330
  ```python
331
  import numpy as np
@@ -335,6 +349,9 @@ def get_image_level_split(n_images, seed=42, train_ratio=0.8):
335
  return perm[:n_train], perm[n_train:]
336
  ```
337
 
 
 
 
338
  ---
339
 
340
  ## Known caveats and good practices
 
97
  │ ├── TIF/ original release format
98
  │ ├── metadata.csv per-frame metadata
99
  │ ├── class_dict.csv
100
+ ── pranet_split.json PRIMARY: PraNet 550/62 image-level split (literature-standard)
101
+ │ └── video_split_seed42.json ALTERNATIVE: leakage-free 23/6 video-level split (more rigorous)
102
 
103
  ├── Kvasir-SEG/ (endoscopy polyp, 1000 images)
104
  │ ├── images/ RGB frames
105
  │ ├── masks/ binary masks
106
  │ ├── bbox/ bounding boxes (auxiliary)
107
+ │ ├── pranet_split.json PRIMARY: PraNet 900/100 train/test split (literature-standard)
108
  │ └── kavsir_seg_README.md original release notes
109
 
110
  ├── REFUGE2/ (fundus optic disc, 1200 images = 400 train + 400 val + 400 test)
 
177
  | **Original task** | Polyp segmentation |
178
  | **Frames / video sequences** | 612 / 29 |
179
  | **Mask convention** | Binary polyp foreground |
180
+ | **PRIMARY split (literature-standard)** | PraNet's **550/62** image-level train/test, used by PraNet, Polyp-PVT, SANet, ESFPNet and most polyp papers |
181
+ | **Primary split file** | `CVC-ClinicDB/pranet_split.json` |
182
+ | **ALTERNATIVE split (leakage-free)** | **Video-level**, 23 train / 6 test sequences, seed=42 (489 frames train, 123 frames test) |
183
+ | **Alternative split file** | `CVC-ClinicDB/video_split_seed42.json` |
184
+ | **Important note** | The PraNet split is image-level and **leaks same-video frames** across train/test (CVC has 29 underlying sequences). Use it for direct comparison to literature; use video-level for honest leakage-free generalization numbers. The two are not directly cross-comparable in absolute Dice. |
185
  | **Source** | [CVC-ClinicDB](https://polyp.grand-challenge.org/CVCClinicDB/) |
186
  | **Reference** | Bernal et al., *Computerized Medical Imaging and Graphics 2015* |
187
  | **License** | Released for academic use; cite the original paper. |
 
194
  | **Original task** | Polyp segmentation |
195
  | **Images** | 1000 |
196
  | **Mask convention** | Binary polyp foreground |
197
+ | **PRIMARY split (literature-standard)** | PraNet's **900/100** train/test (specific file lists), used by PraNet, Polyp-PVT, SANet, ESFPNet and the entire polyp-segmentation literature |
198
+ | **Primary split file** | `Kvasir-SEG/pranet_split.json` |
199
+ | **Leakage risk** | The release does not publish per-procedure metadata. Image-level is the community standard; per-procedure leakage cannot be audited. |
200
+ | **Note** | Filenames in our release use `.jpg` (the original Kvasir-SEG extension); PraNet ships them as `.png` after conversion — basenames match exactly. Auxiliary `bbox/` (bounding boxes) included from the original release. |
201
  | **Source** | [Kvasir-SEG](https://datasets.simula.no/kvasir-seg/) |
202
  | **Reference** | Jha et al., *MMM 2020* |
203
  | **License** | CC-BY-4.0 |
 
242
 
243
  | Dataset | Mainstream literature default | HuggingFace community card | **Our default** | Verdict |
244
  |---|---|---|---|---|
245
+ | CVC-ClinicDB | PraNet's **550/62** image-level files (de facto standard since 2020) | `Angelou0516/CVC-ClinicDB`: 80/10/10 image-level, ESFPNet split | **PraNet 550/62 (`pranet_split.json`) as primary; video-level 23/6 (`video_split_seed42.json`) as leakage-free alternative** | Matches PraNet exactly + adds a leakage-audit option that nobody else ships |
246
+ | Kvasir-SEG | PraNet's **900/100** file list (de facto standard) | `kowndinya23/Kvasir-SEG`: 880/120 (no test) | **PraNet 900/100 (`pranet_split.json`)** | Matches PraNet exactly |
247
  | 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 |
248
  | ISIC 2018 | Official 2594/100/1000 OR pooled 80/20 | varies | Official 2594/100/1000 preserved | Matches official challenge split |
249
  | REFUGE2 | Official 400/400/400 (train/val/test domain-shift design) | varies | Official train/val/test preserved | Matches official |
 
304
  # for img_path in glob.glob(f"{ROOT}/BraTS2020/images/{vol}/*.png"):
305
  # ...
306
 
307
+ # Kvasir-SEG (PraNet 900/100, literature standard)
308
+ info = json.load(open(os.path.join(ROOT, "Kvasir-SEG", "pranet_split.json")))
309
+ train_files = set(info["train_files"]) # 900 file basenames (.jpg)
310
+ test_files = set(info["test_files"]) # 100 file basenames (.jpg)
311
+
312
+ # CVC-ClinicDB (PraNet 550/62, literature standard — has same-video leakage!)
313
+ info = json.load(open(os.path.join(ROOT, "CVC-ClinicDB", "pranet_split.json")))
314
+ train_files = set(info["train_files"]) # 550 frames as <n>.png
315
+ test_files = set(info["test_files"]) # 62 frames as <n>.png
316
+
317
+ # CVC-ClinicDB (video-level 23/6, leakage-free alternative)
318
  info = json.load(open(os.path.join(ROOT, "CVC-ClinicDB", "video_split_seed42.json")))
319
  train_seqs = set(info["train_sequences"])
320
  ```
 
338
  # seg has 4 classes (0=BG, 1=necrotic, 2=edema, 4=enhancing); whole-tumor = (seg > 0)
339
  ```
340
 
341
+ For **BUSI**, the only dataset without a packaged split file, use a
342
+ seed-fixed image-level 80/20 split:
343
 
344
  ```python
345
  import numpy as np
 
349
  return perm[:n_train], perm[n_train:]
350
  ```
351
 
352
+ (BUSI's release does not include patient IDs, so a true patient-level
353
+ split is not possible. See per-dataset notes for caveats.)
354
+
355
  ---
356
 
357
  ## Known caveats and good practices