Supplementary Data S1–S3 and Code S1
Manuscript: Calibrated Confidence and Confidence-Stratified Triage for Diabetic Retinopathy Severity Grading:
A Class-Imbalance-Aware Deep Learning Study on the DDR Dataset (bioengineering-4639529)

Data_S1_out_of_fold_predictions.csv  (12,522 rows, one per DDR image)
  row_index            index of the image in the DDR grading list used in this study
  id_code              DDR image file name
  fold                 outer cross-validation fold (0-4) in which the image was a test image
  repeat               cross-validation repeat (0)
  y_true               ICDR grade (0 no DR, 1 mild NPDR, 2 moderate NPDR, 3 severe NPDR, 4 proliferative DR)
  group                near-duplicate group identifier (Section 3.2)
  temperature          temperature fitted on the calibration split of that fold
  selected_epoch       epoch whose weights were kept
  raw_p0..raw_p4       variant A, raw softmax probabilities
  cal_p0..cal_p4       variant B, temperature-scaled probabilities
  mc_p0..mc_p4         variant C, temperature-scaled MC-Dropout probabilities (M = 20)
  vs_p*, dir_p*, iso_p* vector scaling, Dirichlet (ODIR) and isotonic calibration maps (Section 5.5)
  predictive_entropy_mc, mutual_information_mc, confidence_mc   MC-Dropout uncertainty scores
  pred_*               predicted grade for each variant or map

Data_S2_split_assignments.csv
  repeat, fold, role (train = inner training, cal = calibration, test = outer test), row_index, id_code, diagnosis, group
  One row per image per fold.

Data_S3_misclassified_images.csv
  The 2,127 images misclassified by variant C, with the same columns as Data S1 plus pred_mc and correct,
  sorted by confidence (most confident errors first).

Code_S1/DDR_Revision_Training.ipynb
  Training and evaluation notebook used for all results. Set DATA_ROOT (or the environment variable DDR_DATA_ROOT)
  to the folder holding the DDR grading images and DR_grading.csv. Outputs have been cleared.
Code_S1/preprocessing.py
  Stand-alone preprocessing (border crop, resizing, normalisation, training augmentation).

The DDR images themselves are not redistributed; they are available at https://github.com/nkicsl/DDR-dataset.
