Dual-IFM: pretrained backbones

Pretrained model weights from "Towards Interpretable Foundation Models for Retinal Fundus Images". Code: berenslab/interpretable_FM.

This repo hosts the pretrained SSL backbones only (SimCLR / t-SimCNE / t-SimCNE-2D). To finetune downstream classifiers on top of these backbones, see the GitHub repo.

Variants

One shared repo, one subfolder per variant, all pretrained on a combined EyePACS + AREDS + UKB fundus dataset ("all"):

Subfolder SSL method Backbone Embedding dim Epochs
simclr-bagnet33-256 SimCLR BagNet-33 128 1000
simclr-resnet50-256 SimCLR ResNet-50 128 1000
tsimcne-bagnet33-256 t-SimCNE BagNet-33 2 1000
tsimcne-resnet50-256 t-SimCNE ResNet-50 2 1000
tsimcne2d-bagnet33-256 t-SimCNE-2D (Dual-IFM) BagNet-33 2 1225
tsimcne2d-resnet50-256 t-SimCNE-2D (Dual-IFM) ResNet-50 2 1225

tsimcne2d-bagnet33-256 is the main Dual-IFM checkpoint: trained with t-SimCNE using SimCLR cosine-similarity loss for stage one before switching to the standard t-SimCNE Euclidean/Cauchy-similarity loss for the last two stages.

SimCLR checkpoints keep the standard 128-dim contrastive projection head; t-SimCNE and t-SimCNE-2D mutate the projector's last layer down to 2D during training so the embeddings can be plotted directly, without a separate dimensionality reduction step.

Environment setup

This project uses uv for fast Python environment and dependency management, but the dependencies can be installed into any environment with pip. The hub extra installs huggingface_hub and safetensors, needed to load the weights from the HF Hub.

Option 1 β€” Using uv (recommended)

uv sync --extra hub
source .venv/bin/activate
uv pip install -e .

Option 2 β€” Using pip

pip install -e ".[hub]"

Loading the model

from dual_ifm.utils.hf_hub import DualIFM

model = DualIFM.from_pretrained("CamilaR20/Dual-IFM", subfolder="tsimcne2d-bagnet33-256")

For more usage examples refer to the GitHub repo.

Training data

Pretrained on a combined dataset of retinal fundus images from EyePACS + AREDS + UKB, totalling over 800k images.

Citation

@misc{mensah2026dualifm,
  title={Towards Interpretable Foundation Models for Retinal Fundus Images},
  author={Mensah, Samuel Ofosu and Roa, Camila and Djoumessi, Kerol and Berens, Philipp},
  year={2026},
  eprint={2603.18846},
  archivePrefix={arXiv},
  primaryClass={cs.CV},
  doi={10.48550/arXiv.2603.18846}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Paper for CamilaR20/Dual-IFM