Downloads · 30 days
0
mehmetaytugyuruk/retina-color-spaces-age-prediction
retina-color-spaces-age-prediction is a machine learning model from mehmetaytugyuruk. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Downloads · 30 days
0
Access
Public
Updated Aug 30, 2026
Repo size
2.2 GB
Likes
0
Public
Click a slice to open those files.
.pt2.2 GB · 100%
From the Hugging Face model README
PyTorch checkpoints for the paper:
M. A. Yürük and A. Memiş, "Exploring the Impact of Alternative Color Spaces in Deep Retinal Age Prediction from Fundus Images," ATEEC 2026. Under review.
Code, split manifests, per-model predictions, and full reproduction instructions: github.com/mehmetaytugyuruk/retina-color-spaces-age-prediction
Companion studies on the same dataset: retina-resnet-age-prediction · retina-vit-age-prediction
22 ResNet-50 age regressors, ImageNet-pretrained and fully fine-tuned, that differ only in the color representation of the input or in the training seed. Everything else — the patient-disjoint splits, the architecture, the optimizer, the schedule, the loss, and the checkpoint-selection rule — is identical across every checkpoint. This is what makes the color representation the isolated variable in the study.
The final fully-connected layer is replaced by a regression head predicting a single continuous value: chronological age.
Single-channel models (e.g. hsv_h) receive their one channel replicated three times, so
the input shape expected by the pretrained backbone is preserved without any architectural
change. The Fusion Model is the one exception: its conv1 accepts 12 channels.
Checkpoints are grouped by color-space family. Every file is <family>/<model>.pt.
| File | Input representation | Seed |
|---|---|---|
rgb/rgb_seed42.pt | RGB (all channels) | 42 |
rgb/rgb_seed43.pt | RGB (all channels) | 43 |
rgb/rgb_seed44.pt | RGB (all channels) | 44 |
rgb/rgb_seed45.pt | RGB (all channels) | 45 |
rgb/rgb_seed46.pt | RGB (all channels) | 46 |
rgb/rgb_r_seed42.pt | R channel | 42 |
rgb/rgb_g_seed42.pt | G channel | 42 |
rgb/rgb_b_seed42.pt | B channel | 42 |
lab/lab_seed42.pt | CIELAB (all channels) | 42 |
lab/lab_l_seed42.pt | L (lightness) | 42 |
lab/lab_a_seed42.pt | a (green–red) | 42 |
lab/lab_b_seed42.pt | b (blue–yellow) | 42 |
hsv/hsv_seed42.pt | HSV (all channels) | 42 |
hsv/hsv_h_seed42.pt | H (hue) | 42 |
hsv/hsv_s_seed42.pt | S (saturation) | 42 |
hsv/hsv_v_seed42.pt | V (value) | 42 |
ycrcb/ycrcb_seed42.pt | YCrCb (all channels) | 42 |
ycrcb/ycrcb_y_seed42.pt | Y (luma) | 42 |
ycrcb/ycrcb_cr_seed42.pt | Cr (red-difference) | 42 |
ycrcb/ycrcb_cb_seed42.pt | Cb (blue-difference) | 42 |
grayscale/grayscale_seed42.pt | Grayscale structural control | 42 |
fusion/rgb_lab_hsv_ycrcb_seed42.pt | 12-channel RGB+Lab+HSV+YCrCb (Fusion Model) | 42 |
Each .pt file is a dict. It is self-describing — the preprocessing constants needed
for inference travel with the weights, so no config file is required:
| Key | Contents |
|---|---|
model_state_dict | ResNet-50 weights including the regression head |
normalization.statistics | channel_mean / channel_std for this representation, computed from the train split only |
target_statistics | mean, sample_std, min_age, max_age, n for age denormalization |
model_selection | Selection metric and its value (validation_mae) |
epoch | Epoch the selected checkpoint came from |
representation | Representation name and contract fingerprint |
resolved_config | The complete resolved training configuration |
runtime | Device, seed, and exact library versions used for the run |
config_fingerprint | Hash pinning the run to its configuration |
The model is trained on normalized age targets. Recover years with:
predicted_age = raw_output * target_statistics["sample_std"] + target_statistics["mean"]
Research and reproducibility for the associated paper — benchmarking, ablation studies, or extension work on retinal-fundus age prediction and color-representation ensembling. Not intended for clinical or diagnostic use; neither the dataset nor the models have been clinically validated.
Test-set MAE in years (1,462 images). Full-precision values; the paper rounds to two decimals.
| Configuration | Members | Test MAE |
|---|---|---|
| Ensemble 1 | RGB + Lab + HSV + YCrCb (seed 42) | 4.5983 |
| Ensemble 2 | RGB seeds 43–46 | 4.7436 |
| Fusion Model | 12-channel early fusion | 5.2039 |
Ensemble 1 beats the equal-cost Ensemble 2 control by 0.1453 years (3.06% relative).
A paired patient-level cluster bootstrap (100,000 repetitions, 809 test patients resampled
as clusters) gives a 95% CI of [0.0133, 0.2773] years, with 98.417% of repetitions
positive.
Combining different color spaces helps; combining more RGB seeds helps less; merging the color spaces at the input instead of at the prediction (the Fusion Model) helps least. The four color spaces are invertible transformations of one another, which limits what a single jointly-trained model can extract from their concatenation.
| Representation | Validation MAE | Test MAE |
|---|---|---|
| RGB | 5.4090 | 4.9067 |
| YCrCb | 5.4046 | 5.1084 |
| Lab | 5.5419 | 5.2448 |
| HSV | 5.4661 | 5.2852 |
| Grayscale | 6.1552 | 5.9976 |
No non-RGB full representation beats RGB on the test split.
| Representation | Validation MAE | Test MAE |
|---|---|---|
| YCrCb-Y | 6.0825 | 5.6944 |
| RGB-G | 6.1317 | 5.8333 |
| HSV-S | 6.3637 | 5.9151 |
| YCrCb-Cb | 6.5453 | 5.9632 |
| Lab-b | 6.5460 | 6.0295 |
| Lab-a | 6.7317 | 6.0522 |
| RGB-B | 6.5042 | 6.0592 |
| Lab-L | 6.4377 | 6.0677 |
| HSV-H | 6.5357 | 6.1345 |
| YCrCb-Cr | 6.4902 | 6.1461 |
| RGB-R | 7.0720 | 6.7047 |
| HSV-V | 7.1904 | 6.7435 |
Every single-channel model is worse than full RGB. YCrCb-Y is the strongest single channel.
| Model | Test MAE |
|---|---|
| RGB seed 42 | 4.9067 |
| RGB seed 43 | 5.0659 |
| RGB seed 44 | 4.9930 |
| RGB seed 45 | 4.9849 |
| RGB seed 46 | 5.1115 |
import torch
import torch.nn as nn
from torchvision import models
from huggingface_hub import hf_hub_download
REPO = "mehmetaytugyuruk/retina-color-spaces-age-prediction"
ckpt = torch.load(
hf_hub_download(REPO, "rgb/rgb_seed42.pt"),
map_location="cpu",
weights_only=False,
)
model = models.resnet50(weights=None)
model.fc = nn.Sequential(
nn.Linear(2048, 512), nn.BatchNorm1d(512), nn.ReLU(inplace=True), nn.Dropout(0.4),
nn.Linear(512, 128), nn.BatchNorm1d(128), nn.ReLU(inplace=True), nn.Dropout(0.3),
nn.Linear(128, 1),
)
model.load_state_dict(ckpt["model_state_dict"])
model.eval()
# Preprocessing constants travel with the checkpoint.
stats = ckpt["normalization"]["statistics"]
mean = torch.tensor(stats["channel_mean"]).view(3, 1, 1)
std = torch.tensor(stats["channel_std"]).view(3, 1, 1)
target = ckpt["target_statistics"]
# image: float32 tensor, shape (3, 224, 224), values in [0, 1],
# already cropped to the retinal field and zero-padded (see the GitHub repo).
# image = (image - mean) / std
# with torch.no_grad():
# raw = model(image.unsqueeze(0)).item()
# predicted_age = raw * target["sample_std"] + target["mean"]
Loading a single-channel model (e.g. hsv/hsv_h_seed42.pt) is identical — replicate the
selected channel three times before normalizing. The Fusion Model needs a 12-channel
conv1; see build_resnet50_12ch_regressor() in the GitHub repository.
Full preprocessing, inference, and evaluation code: github.com/mehmetaytugyuruk/retina-color-spaces-age-prediction.
Checkpoints released under the MIT License. The training dataset is separately MIT-licensed by its original authors.
@inproceedings{yuruk2026colorspaces,
title = {Exploring the Impact of Alternative Color Spaces in Deep Retinal
Age Prediction from Fundus Images},
author = {Yürük, Mehmet Aytuğ and Memiş, Abbas},
booktitle = {ATEEC 2026},
year = {2026},
note = {Under review}
}