Dataset F is derived from Dataset E
by removing every PUNLMP frame and re-deriving a patient-level
train / validation / test split from scratch. It is prepared for 3-class deep
learning (malignant vs non-malignant vs non-ROI) and keeps the same per-image
schema as Dataset E (image, cancer_label, grade_label, subclass_label,
source_dataset, original_filename, patient_id, imaging_type, target3,
track_id, cv_fold).
Total images: 14,376 (E had 14,921; 545 PUNLMP frames removed)
Unique patients / cases: 209 (E had 212; the 3 PUNLMP-only source-B patients 6, 8, 29 are dropped)
Splits: train / validation / test (70 / 15 / 15), patient-level with no leakage
5-fold cross-validation on the train pool (cv_fold 0-4; -1 for val/test)
Relationship to Dataset E
Dataset E
Dataset F
Total images
14,921
14,376
Patients
212
209
non_malignant images
900
355
PUNLMP frames
545 (source-B non_malignant)
0 (excluded)
Split derivation
seed 16, 14 swaps
seed 17, 12 swaps (re-searched)
PUNLMP Exclusion
In Dataset E, PUNLMP (Papillary Urothelial Neoplasm of Low Malignant Potential)
is the histological_type of 12 source-B videos (milkyroad/B), and every
source-B non_malignant frame in E comes from those PUNLMP videos (E patients
6, 8, 29; tracks 028, 029, 032-037, 162-165). Therefore:
PUNLMP frames == (source_dataset == 'B') AND (target3 == 'non_malignant')
Removing them drops the non_malignant class from 900 -> 355 images, all now
coming from sources C and D. Because this makes a good patient-level split much
harder, the split is re-derived from scratch (Dataset F does not inherit
Dataset E's split assignment).
Source Datasets
Code
Source
Type
Images in F
Patients in F
B
Cystoscopy video dataset (stride-8 frames)
Video frames
4,555
27
C
CystoDS
Still cystoscopy images
8,067
160
D
Kaggle cystoscopy frames
Still cystoscopy frames
1,754
22
Source-B majority-class frames (malignant + non-ROI) in E are already capped at
60 per (patient, track); Dataset F's split search used cap=None, i.e. it
keeps E's existing 60-cap and never adds frames. Source-B non_malignant
(PUNLMP) frames are excluded entirely, so all 4,555 source-B images in F are
malignant or non_roi.
Patient ID normalization (unchanged from E)
Source
Original ID field
Normalized range
Count
B
patient_id (0-29)
1-30
27 (3 PUNLMP-only patients dropped)
C
pid
31-190
160
D
case_id (0-25)
191-212
22
Label Derivation
Identical to Dataset E. See E's dataset card for the full per-source mapping.
The derived 3-class task label is:
subclass_label
target3
malignant (0)
malignant (0)
non_malignant (1)
non_malignant (1)
normal (2)
non_roi (2)
landmark (3)
non_roi (2)
foreign_body (4)
non_roi (2)
Train / Validation / Test Split
Patient-level stratified split using StratifiedGroupKFold
(source x dominant-class stratification) for test, then for train/val, followed
by greedy patient-swap refinement that minimises the maximum per-class
per-split fill-ratio deviation. Hard constraints: every split contains every
class and every source; a source-floor of 4 patients per source in val and test.
A grid search over (seed, per-track cap, source_floor) selected the
configuration with the lowest score
(score = max_fill_dev + penalties):
Split ratio: 70 / 15 / 15 (train / val / test)
Best config: cap=None, source_floor=4, seed=17
Swaps applied: 12
Max fill-ratio deviation: 0.0047
No patient appears in more than one split (verified)
Split sizes
Split
Images
Patients
train
10,067
150
validation
2,157
31
test
2,152
28
Total
14,376
209
Class distribution per split
Class
Total
Train
Val
Test
malignant
6,515 (45.3%)
4,562
975
978
non_malignant
355 (2.5%)
249
53
53
non_roi
7,506 (52.2%)
5,256
1,129
1,121
Fill ratios (count / target, ideal = 1.00)
Class
Train
Val
Test
malignant
1.00
1.00
1.00
non_malignant
1.00
1.00
1.00
non_roi
1.00
1.00
1.00
Source x split (patients)
Source
Train
Val
Test
B
19
4
4
C
117
23
20
D
14
4
4
Source x split (images)
Source
Train
Val
Test
B
3,402
447
706
C
5,654
1,224
1,189
D
1,011
486
257
Non-malignant patient coverage
Split
Patients
Images
train
53
249
validation
12
53
test
12
53
All non_malignant images in F come from sources C and D (source-B
non_malignant / PUNLMP is excluded).
5-Fold Cross-Validation (train pool only)
StratifiedGroupKFold on the train split (per-image target3 stratification,
patient-level grouping, no patient in multiple folds, seed=15, 5 folds).
Fold
Patients
Images
Malignant
Non-mal
Non-ROI
0
27
2,008
912
49
1,047
1
30
2,017
912
50
1,055
2
33
1,988
912
49
1,027
3
29
2,055
913
50
1,092
4
31
1,999
913
51
1,035
The cv_fold column is -1 for validation and test patients.
Note on minority-class (non-malignant) fold balance
After PUNLMP exclusion the non_malignant class shrinks to 355 images and
remains heavily patient-concentrated: only 53 train patients carry
non_malignant frames and a few patients dominate the count. Because
cross-validation is patient-grouped (a patient never appears in more than one
fold), high-volume patients cannot be split across folds, so the per-fold
non-malignant count varies modestly (49-51) while the majority classes stay
near-perfectly balanced (malignant spread 912-913; non-ROI spread 1,027-1,092).
Practitioners should report per-fold non-malignant counts alongside metrics and
prefer the macro-averaged F1 across all five folds over any single fold's score
when estimating minority-class performance.
Dropping all PUNLMP frames (source_dataset == 'B' and target3 == 'non_malignant').
Grid-searching (seed, cap, source_floor) for the patient-level split that
minimises the maximum per-class per-split fill-ratio deviation, with hard
coverage constraints.
Attaching a 5-fold StratifiedGroupKFold CV assignment (seed=15) to the
train pool.