|
Algorithm 1: RETFound-Based DRIL Classification Architecture. |
| 1: |
Input: OCT images with foveal annotations |
| 2: |
Model: RETFound (Vision Transformer) |
| 3: |
// Phase 1: Preprocessing the OCT Images and extracting central foveal 1 mm region |
| 4: |
for all class
do
|
| 5: |
for all image in class c
do
|
| 6: |
Load Ii and annotation file |
| 7: |
Read foveal center coordinates
|
| 8: |
|
| 9: |
|
| 10: |
Save
|
| 11: |
end for
|
| 12: |
end for |
| 13: |
// Phase 2: Splitting the dataset for training and testing |
| 14: |
Read all preprocessed images |
| 15: |
Shuffle with seed = 42 |
| 16: |
|
| 17: |
// Phase 3: Cross-validation and model training |
| 18: |
Initialize
|
| 19: |
for to K do
|
| 20: |
Split into Train and Validation sets |
| 21: |
Initialize RETFound with pretrained weights |
| 22: |
Freeze backbone layers |
| 23: |
Train classification head |
| 24: |
Unfreeze layers for fine-tuning |
| 25: |
Validate on Validation set |
| 26: |
end for |
| 27: |
// Phase 4: Model selection and evaluation |
| 28: |
Select best model based on cross-validation performance |
| 29: |
Evaluate final fold-specific trained models on the held-out test set |
| 30: |
Compute-AC, SE, SP, AUC, MCC and Plot Visualizations and other curves |