Retinal Fundus Age Prediction — Vision Transformer
PyTorch checkpoints for the paper:
M. A. Yürük and A. Memiş, "Decoding Chronological Age from the Retinal Fundus Images: A Deep Learning-based Analysis with Vision Transformers," in
2026 34th Signal Processing and Communications Applications Conference (SIU), İstanbul, Türkiye, Jul. 2026, pp. 1–4. doi:
10.1109/SIU71813.2026.11636734
Companion study (ResNet backbones, same dataset):
mehmetaytugyuruk/retina-resnet-age-prediction
Model description
Four Vision Transformer variants (ViT-B/16, ViT-B/32, ViT-L/16, ViT-L/32), ImageNet-1K-pretrained and fully fine-tuned, with the classification head replaced by a single-neuron regression head predicting chronological age. Age-category classification (Pediatric / Young Adult / Middle Age / Senior / Elderly) is derived from the regression output at evaluation time only. All four variants were trained on Graham-filtered retinal images only (the only preprocessing variant used in this paper).
Files
| File | Backbone | Patch size | Layers | Hidden size | Heads |
|---|
vit-b16-filtered.pth | ViT-B/16 | 16×16 | 12 | 768 | 12 |
vit-b32-filtered.pth | ViT-B/32 | 32×32 | 12 | 768 | 12 |
vit-l16-filtered.pth | ViT-L/16 | 16×16 | 24 | 1024 | 16 |
vit-l32-filtered.pth | ViT-L/32 | 32×32 | 24 | 1024 | 16 |
Each checkpoint is a dict with keys: model_state_dict, mean_age, std_age, epoch, val_loss, val_mae. Predicted age is recovered as pred = model(image) * std_age + mean_age.
Intended use
Research and reproducibility for the associated paper — benchmarking, ablation studies, or extension work on retinal-fundus age prediction. Not intended for clinical or diagnostic use; the underlying dataset and models have not been clinically validated.
Training details
- Dataset: Retina Age Analysis Dataset (Kamran, 2025), 9,857 fundus images, patient-level split (6,902 train / 1,493 validation / 1,462 test) — same split as the companion ResNet study.
- Preprocessing: retina disk cropped, padded, and resized to 224×224, followed by a Ben Graham filter.
- Loss: Smooth L1, reweighted per-sample via Label Distribution Smoothing (LDS).
- Optimizer: AdamW, weight decay 0.05. Learning rate 3e-5 for ViT-B/16, ViT-B/32, and ViT-L/32; 2e-5 for ViT-L/16 (reduced for training stability given its larger size).
- Warmup: 5 epochs training only the regression head before unfreezing the full backbone.
- Scheduler: ReduceLROnPlateau (factor 0.5, patience 5 epochs).
- Epochs: 80.
Evaluation results
Values below are exactly as reported in the paper's Table V (test set, 1,462 images, Graham-filtered). MAE in years; Accuracy/F1 are for the derived 5-class age categorization.
| Model | MAE | Accuracy | F1 |
|---|
| ViT-B/16 | 4.99 | 0.8368 | 0.6974 |
| ViT-B/32 | 5.52 | 0.8241 | 0.6764 |
| ViT-L/16 | 4.86 | 0.8497 | 0.7219 |
| ViT-L/32 | 5.59 | 0.8211 | 0.6684 |
ViT-L/16 is the best-performing model overall. The paper additionally reports a point-estimate comparison against the companion ResNet study's results (ResNet-101, MAE 5.01 as cited in this paper's own Table VI).
Limitations
- Trained and evaluated on a single public dataset; generalization to other populations, imaging devices, or acquisition protocols is untested.
- Not clinically validated — do not use for diagnosis, screening, or any medical decision-making.
- Age-category boundaries are derived post-hoc from a regression output, not directly optimized as a classification objective.
- ViT-L/16's lower learning rate (2e-5) versus the other three variants (3e-5) is a real methodological detail not explicitly called out in the paper's own methods section; documented here and in the GitHub repo for transparency.
- The dataset's demographic composition and any consent/de-identification details are governed by the original dataset authors, not verified independently here.
Example usage
1import torch
2import torch.nn as nn
3from torchvision import models
4from huggingface_hub import hf_hub_download
5
6ckpt_path = hf_hub_download("mehmetaytugyuruk/retina-vit-age-prediction", "vit-l16-filtered.pth")
7ckpt = torch.load(ckpt_path, map_location="cpu", weights_only=False)
8
9model = models.vit_l_16(weights=None)
10model.heads.head = nn.Linear(model.heads.head.in_features, 1)
11model.load_state_dict(ckpt["model_state_dict"])
12model.eval()
13
14# pred_age = model(image_tensor).item() * ckpt["std_age"] + ckpt["mean_age"]
Full preprocessing and inference code: see the
GitHub repository.
License
Checkpoints released under the
MIT License. The training dataset is separately MIT-licensed by its original authors.
Citation
1@inproceedings{yuruk2026decoding,
2 title = {Decoding Chronological Age from the Retinal Fundus Images: A Deep Learning-based Analysis with Vision Transformers},
3 author = {Yürük, Mehmet Aytuğ and Memiş, Abbas},
4 booktitle = {2026 34th Signal Processing and Communications Applications Conference (SIU)},
5 year = {2026},
6 pages = {1--4},
7 address = {İstanbul, Türkiye},
8 publisher = {IEEE},
9 doi = {10.1109/SIU71813.2026.11636734}
10}