A unified cystoscopy image dataset assembled from three independent sources,
prepared for 3-class deep learning (malignant vs non-malignant vs non-ROI).
Every image carries a cancer label, a grade label, a subclass label,
and a derived target3 label for the 3-class task.
Splits: train / validation / test (70 / 15 / 15), patient-level with no leakage
Source Datasets
Code
Source
Type
Images (raw)
Images (after cap)
Patients/Cases
B
Cystoscopy video dataset
Video frames (stride 8)
6,519
5,100
30
C
CystoDS
Still cystoscopy images
8,067
8,067
160
D
Kaggle cystoscopy frames
Still cystoscopy frames
1,754
1,754
22
Source B frame capping
Source B video frames are temporally autocorrelated (stride 8 extraction).
To reduce redundancy, majority-class frames (malignant + non-ROI) are capped
at 60 per (patient, track). Non-malignant frames are always kept.
This reduces source B from 6,519 to 5,100 images (cap=60, seed=42).
Patient-level stratified split using StratifiedGroupKFold (source x dominant-class
stratification) + post-split patient swapping to minimize fill-ratio deviation.
Split ratio: 70 / 15 / 15 (train / val / test)
Seed: 16
Swaps applied: 14
No patient appears in more than one split (verified)
Split sizes
Split
Images
Patients
train
10,436
148
validation
2,244
35
test
2,241
29
Total
14,921
212
Class distribution per split
Class
Total
Train
Val
Test
malignant
6,515 (43.7%)
4,568
982
965
non_malignant
900 (6.0%)
631
135
134
non_roi
7,506 (50.3%)
5,237
1,127
1,142
Fill ratios (count / target, ideal = 1.00)
Class
Train
Val
Test
malignant
1.00
1.00
0.99
non_malignant
1.00
1.00
0.99
non_roi
1.00
1.00
1.01
Source x split (patients)
Source
Train
Val
Test
B
21
4
5
C
115
25
20
D
12
6
4
Source x split (images)
Source
Train
Val
Test
B
3,763
760
577
C
5,821
1,129
1,117
D
852
355
547
Non-malignant patient coverage
Split
Patients
Images
train
55
631
validation
12
135
test
13
134
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).
Fold
Patients
Images
Malignant
Non-mal
Non-ROI
0
26
2,028
914
61
1,053
1
35
2,119
913
170
1,036
2
31
2,026
915
61
1,050
3
26
2,026
913
61
1,052
4
30
2,237
913
278
1,046
The cv_fold column is -1 for validation and test patients.
Note on minority-class (non-malignant) fold balance
Non-malignant images are heavily patient-concentrated in this dataset: in the
train pool, two patients alone account for around 70% of all non-malignant images
(274 and 168 images respectively), and only 17 of 148 train patients are
non-malignant dominant. Because cross-validation is patient-grouped (a patient
never appears in more than one fold), these high-volume patients cannot be
split across folds and inevitably land in a single fold each. As a result,
two folds carry an elevated non-malignant proportion (~8% and ~12%) while the
other three sit at ~3%, against a train-pool baseline of ~6%.
This is an inherent limitation of the dataset's patient-level grouping, not of
the splitting algorithm. StratifiedGroupKFold guarantees that every fold's
training portion contains non-malignant-dominant patients and keeps the
majority classes (malignant, non-ROI) near-perfectly balanced across folds
(malignant spread: 913-915; non-ROI spread: 1,036-1,053). 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.