Downloads · 30 days
0
CamilaR20/Dual-IFM
Dual-IFM is a image feature extraction model from CamilaR20. Use it for the image feature extraction task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
Pretrained model weights from "Towards Interpretable Foundation Models for Retinal Fundus Images". Code: berenslab/interpretableFM.
Downloads · 30 days
0
Access
Public
Updated Aug 10, 2026
Repo size
530 MB
Likes
1
Public
Click a slice to open those files.
.safetensors530 MB · 100%
From the Hugging Face model README
Pretrained model weights from "Towards Interpretable Foundation Models for Retinal Fundus Images". Code: berenslab/interpretable_FM.
This repo hosts the pretrained SSL models only (SimCLR / t-SimCNE / t-SimCNE-2D). To finetune downstream classifiers on top of these weights see the GitHub repo.
Dual-IFM is an interpretable foundation model for retinal fundus images that combines local explanations with a direct visualization of the representation space:
One shared repo, one subfolder per variant, all pretrained on a combined EyePACS + AREDS + UKB fundus dataset ("all"). All subfolder names follow the format: <method>-<backbone>-<image_size>, all models were trained at a 256x256 resolution.
| 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.
Pretrained on images from three color fundus photography (CFP) datasets, preprocessed (cropped to a centered circle) and filtered for quality, totalling 802,360 images:
| Dataset | Images | Participants |
|---|---|---|
| EyePACS | 567,384 | 44,063 |
| AREDS | 110,690 | 4,432 |
| UK Biobank (UKB) | 132,010 | 72,711 |
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.
Clone the GitHub repository:
git clone https://github.com/berenslab/interpretable_FM.git
cd interpretable_FM
uv sync --extra hub
source .venv/bin/activate
uv pip install -e .
pip install -e ".[hub]"
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 repository.
Dual-IFM was evaluated via linear probing and fine-tuning on held-out test sets of the pretraining datasets (EyePACS, AREDS) as well as out-of-distribution datasets: APTOS, IDRiD, DeepDRiD, and Messidor-2 (diabetic retinopathy grading), Glaucoma fundus and PAPILA (glaucoma detection), and FIVES (multi-disease classification).
It performs comparably to RETFound (ViT-Large), while using roughly 16× fewer parameters (18.3M for BagNet-33 vs. 303.3M for RETFound).
This is a research model, not a clinically validated diagnostic tool. It has not been evaluated for deployment in clinical setting, and performance on populations or imaging devices not represented in the pretraining data (EyePACS, AREDS, UKB) is not guaranteed.
@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}
}