Manuscript Offprint
arXiv:2610.33340Compression of Vision Foundation Models for Retinal OCT via Growing-Neural-Gas Codebooks and Graph-Guided Masked Image Modeling
Abstract
Vision foundation models for retinal imaging are large and computationally demanding, limiting point-of-care deployment. We ask how much of such a model's downstream utility survives compression into a smaller network. We propose a topology-aware discretization framework that distills a continuous foundation model into a discrete codebook, then uses it as the reconstruction target for masked image modeling (MIM). It combines gradient-free codebook learning via Growing Neural Gas, which yields an adjacency graph over the codes, with a graph-distance soft cross-entropy loss that replaces one-hot MIM targets with topologically graded supervision. With student pretraining on 383 public Duke iAMD optical coherence tomography (OCT) volumes, the pipeline distills an 86M-parameter teacher into a 22M-parameter student with fewer FLOPs. The student performs close to, and in some settings above, its teacher across three classification and two segmentation benchmarks, with the magnitude and direction of the difference depending on the teacher, task, metric, and student capacity. On the external OLIVES benchmark, it surpasses its MIRAGE teacher on every metric (98.06% vs. 95.22% balanced accuracy). It works with two Vision Transformer (ViT-Base) teachers, retinal (MIRAGE) and natural-image (DINOv3); with the out-of-domain teacher, the student outperforms it on retinal-layer segmentation, indicating that the added value of retina-specific pretraining is task-dependent: largest for segmentation, while a general-domain teacher is competitive for classification. These results yield compact retinal models potentially suitable for deployment, transferring across OCT datasets, devices, and clinical tasks, including three datasets not used in the student's pretraining.
Keywords: Optical coherence tomography, Masked image modeling, Knowledge distillation, Topological codebook learning
*Corresponding author.
Email address: ali.yavari@meduniwien.ac.at (Ali Yavari)
1. Introduction
Retinal diseases including age-related macular degeneration (AMD), diabetic macular edema (DME), and choroidal neovascularization (CNV) impose a major and growing clinical burden worldwide, driven by population aging and the diabetes epidemic, and represent leading causes of vision impairment and blindness (Wong et al., 2014). Optical coherence tomography (OCT) has become the indispensable workhorse imaging modality for screening, diagnosis, and longitudinal monitoring of these conditions, delivering high-resolution, non-invasive cross-sectional visualization of retinal microstructure that directly informs anti-VEGF treatment decisions and disease activity assessment (Flaxel et al., 2020). Deep learning has become integral to automated OCT interpretation, yet conventional supervised approaches remain constrained by the scarcity of large, expert-annotated retinal datasets, motivating a shift toward self-supervised pretraining that learns directly from unlabeled scans (Morano et al., 2025). Within this paradigm, Vision Transformer-based foundation models—including the general-domain DINOv3 (Siméoni et al., 2025) and retina-specific models such as RETFound (Zhou et al., 2023), VisionFM (Qiu et al., 2024), EyeCLIP (Shi et al., 2025), and MIRAGE (Morano et al., 2025)—have demonstrated that large-scale self-supervised pretraining yields transferable representations that consistently outperform models trained from scratch or pretrained on ImageNet across diagnostic and prognostic retinal tasks. A single such backbone can deliver strong performance across both classification and segmentation of OCT images, making vision foundation models an increasingly attractive basis for retinal image analysis.
Despite this promise, the foundation models driving these gains are typically large, GPU-intensive architectures, and their substantial computational and infrastructure requirements remain a major obstacle to real-time deployment on portable devices or in resource-constrained clinical settings (Jin et al., 2026; Chia et al., 2024). Compounding this barrier, building a foundation model with broad generalizability typically demands pretraining on large, heterogeneous datasets pooled across institutions and imaging devices, a scale of data acquisition and curation that is logistically and financially prohibitive for most individual research groups or clinical centers (Chia et al., 2024; Zhou et al., 2026). A natural avenue to sidestep the data constraint is masked image modeling (MIM), a self-supervised paradigm that eliminates the need for labeled data and, in principle, allows pretraining on more modest unlabeled datasets. Pixel-level MIM approaches reconstruct raw image patches from masked inputs, an objective that is easy to optimize but biases the encoder toward low-level texture statistics rather than high-level semantic features (He et al., 2022). Lifting the reconstruction target to the semantic level — by predicting discrete visual tokens produced by a vector-quantized tokenizer rather than raw pixels — was proposed as a remedy (Bao et al., 2022; Ramesh et al., 2021; Peng et al., 2023); yet standard vector quantization imposes no relational structure among learned tokens, and the one-hot MIM target treats every incorrect code as equally wrong. Crucially, both MIM generations were developed for large, GPU-intensive encoders, and neither was designed to transfer the semantic knowledge embedded in those models into a lightweight backbone suitable for point-of-care inference. Distillation into compact Vision Transformers has been studied on natural images, for example by DeiT, which transfers a teacher's class predictions through a dedicated distillation token during supervised ImageNet training (Touvron et al., 2021), and by TinyMIM, which transfers token relations from larger MIM-pretrained ViTs to smaller ones on ImageNet (Ren et al., 2023). Both were developed on large natural-image corpora with labels or continuous targets; they do not consider distillation from a foundation model through graph-structured discrete targets on a small, unlabeled in-domain medical cohort.
To address this gap, we propose a topology-aware discrete distillation framework that compresses the knowledge of a continuous vision foundation model into a compact discrete codebook, which then serves as the reconstruction target for masked image modeling. Rather than relearning representations from scratch, a student encoder is pretrained to predict the codes of a frozen teacher, transferring the teacher's semantic knowledge into a more compact backbone, as in knowledge distillation (Phuong and Lampert, 2019; Tian et al., 2020); at its smallest, this yields a model with a reduced parameter footprint potentially suitable for deployment. The framework rests on three components. First, we learn the codebook with Growing Neural Gas (GNG), a gradient-free vector quantization method: the codebook grows adaptively through topology-driven insertion and pruning. Second, GNG yields not only the codes but also an adjacency graph linking them, endowing the discrete vocabulary with relational structure that standard tokenizers lack. Third, we exploit this structure through a graph-distance soft cross-entropy loss that replaces the flat one-hot MIM target with topologically graded supervision, so that predicting a code near the correct one on the graph is penalized less than predicting a distant one—turning masked prediction into structured prediction over the learned codebook. We instantiate the framework with two teachers from different domains—a retina-specific foundation model (MIRAGE; Morano et al., 2025) and a general-domain natural-image model (DINOv3; Siméoni et al., 2025)—and pretrain the student using only a single small public OCT dataset, Duke iAMD (Farsiu et al., 2014). Both teachers evaluated here are ViT-Base with D=768, and the same pipeline applies unchanged to each.
We first evaluate the framework along two axes: how much it compresses, and how much of the teacher's downstream utility the compressed student preserves. Using this pipeline, an 86M-parameter teacher is distilled into a 22M-parameter student—roughly a fourfold reduction in size—which we assess across three OCT classification benchmarks and two segmentation benchmarks, spanning multiple datasets, imaging devices, and clinical tasks. Across these benchmarks the compact student achieved performance close to, and on individual tasks above, the teacher's, although the magnitude and direction of the difference depended on the teacher, task, metric, and student capacity. The same result holds for both the retina-specific and the natural-image teacher, which is consistent with the gains arising from the distillation framework rather than from any single backbone. Because the same pipeline runs unchanged with both teachers, it also lets us ask a second question: for which tasks a retina-specific foundation model still adds value relative to a general-domain backbone passed through the same pipeline. Taken together, these findings offer a route to compact retinal image models potentially suitable for deployment and, more broadly, a recipe for compressing medical vision foundation models into efficient backbones without re-collecting the large, multi-source corpora their original pretraining required.
2.1. Framework overview
We build on a two-stage self-supervised framework for learning transferable representations from retinal OCT B-scans (Fig. 1). In the first stage, an image tokenizer distills the representation space of a frozen vision foundation model (the teacher) into a discrete codebook learned with Growing Neural Gas (GNG; Fritzke, 1995), which also induces an adjacency graph over the codes (Section 2.4). In the second stage, the resulting tokens serve as prediction targets for masked image modeling (MIM), through which a more compact backbone (the student) is pretrained on unlabeled OCT data with a graph-distance soft cross-entropy objective (Section 2.5). The pretrained student is then evaluated on image-level classification and pixel-level segmentation.
2.2. Pretraining dataset
All self-supervised pretraining experiments were conducted exclusively on the Duke intermediate age-related macular degeneration dataset (Duke iAMD) (Farsiu et al., 2014), a publicly available SD-OCT cohort collected across four clinical sites in the United States. The dataset encompasses 384 volumetric SD-OCT scans from 384 subjects, comprising 269 patients diagnosed with intermediate AMD and 115 age-matched healthy controls. All volumes were acquired using a Bioptigen SD-OCT system (Bioptigen Inc., Research Triangle Park, NC, USA). Each volume covers a retinal field of view of approximately centered on the fovea and consists of 100 B-scans, each of pixels (axial lateral).
In addition to subject-level diagnostic labels, the dataset provides dense, expert-annotated boundary delineations defining three anatomically distinct retinal regions: (i) the layer spanning from the inner limiting membrane (ILM) to the inner boundary of the retinal pigment epithelium and drusen complex (RPEDC), (ii) the RPEDC itself, bounded inferiorly by the outer surface of Bruch's membrane (BM), and (iii) the sub-BM region. These boundary annotations were used to define the segmentation targets in all downstream evaluation experiments. One volume was excluded prior to any model training owing to
A) GNG-based image tokenizer

B) Masked image modeling with GNG graph guidance

Figure 1: Overview of the GNG-guided pretraining framework. A GNG-based image tokenizer: a ViT encoder's patch embeddings are quantized against a codebook grown by Growing Neural Gas (GNG) to codes in a -dimensional space (straight-through gradient), and a decoder reconstructs the frozen teacher's embeddings under a cosine loss ; GNG also induces the adjacency graph used in B. B Masked image modeling with GNG graph guidance: masked-token targets are softened by the graph distance between codes, giving a patch-level objective and, via class-token aggregation, a global objective . Only the student encoder is kept for downstream tasks.
a detected annotation inconsistency, yielding a final pretraining corpus of 383 volumes corresponding to approximately 38,300 B-scans.
Because no labels are used during pretraining, reusing Duke iAMD as a downstream benchmark introduces no label leakage. All 383 volumes were therefore available during self-supervised pretraining before the downstream train/validation/test split was formed, making Duke iAMD a label-free transductive evaluation. This follows the established masked-image-modeling protocol used by BEiT-2: its VQ-KD tokenizer and MIM encoder are pretrained on ImageNet-1K and the representation is subsequently fine-tuned or linearly probed on ImageNet-1K (Peng et al., 2023).
2.3. Benchmark datasets
We evaluated the pretrained backbone on five benchmarks drawn from four publicly available OCT datasets, spanning two task families: three for image-level classification (Kermany, Kermany, 2018; Kermany et al., 2018; OLIVES, Prabhushankar et al., 2022; Duke iAMD, Farsiu et al., 2014) and two for pixel-level segmentation (AROI, Melinščak et al., 2021; Duke iAMD, Farsiu et al., 2014), summarized in Table 1. Together they cover multiple retinal pathologies, three distinct acquisition devices, and independent acquisition sites. Duke iAMD is evaluated transductively (Section 2.2), whereas Kermany, OLIVES, and AROI, none of which was used for self-supervised pretraining, provide cross-dataset transfer evaluations. For the volumetric classification datasets (Duke iAMD and OLIVES) we restricted the analysis to the central B-scan of each volume, consistent with prior work (Morano et al., 2025; Zhou et al., 2023). For the segmentation datasets, all annotated B-scans were used, with each patient's B-scans assigned to a single partition, in line with standard practice in which retinal layer and lesion segmentation are performed B-scan-wise rather than at the volume level (Morano et al., 2025; He et al., 2021; Fazekas et al., 2023; Roy et al., 2017). Where official train/validation/test splits were available we adopted them directly. For Duke iAMD and the segmentation datasets we used a patient-level stratified split; for OLIVES we used the label-stratified patient-level split described in Section 2.6.
2.4. GNG-based image tokenizer
The first stage learns a discrete image tokenizer that distills a frozen vision foundation model into a codebook. We describe the tokenizer for a generic frozen teacher T and instantiate T with two backbones: MIRAGE (Morano et al., 2025), which is, to our knowledge, the most recent published retinal vision foundation model, and the general-domain DINOv3 (Siméoni et al., 2025). Each teacher is distilled into its own, independently trained tokenizer, which comprises three modules (Fig. 1-A). (i) A tokenizer encoder (with parameters ) embeds an input B-scan into a grid of continuous patch embeddings. (ii) A quantizer maps each (projected) embedding to the nearest code of a discrete codebook , whose codes and connecting topology are maintained by GNG. (iii) A shallow decoder (with parameters ) reconstructs, from
Table 1: Benchmark datasets used for downstream evaluation. Scan counts are B-scans; volume/subject counts are given in parentheses where applicable. Segmentation used only the expert-annotated B-scans: 1,105 for AROI and 29,291 for Duke iAMD (74–77 per volume).
| Dataset | Device | Scans (n) | Classes / Labels (n) |
|---|---|---|---|
| Classification | |||
| Kermany | Spectralis | 84,484 | CNV (37,455), DME (11,598), Drusen (8,866), Normal (26,565) |
| OLIVES | Spectralis | (1,594 vols.) | DME (934), DR (660) |
| Duke iAMD | Bioptigen SD-OCT | (383 vols.) | Control (114), iAMD (269) |
| Segmentation | |||
| AROI | Zeiss Cirrus | 2,944 (23 pts.) | Background (above ILM), ILM-IPL/INL, IPL/INL-RPE, RPE-BM, sub-BM, PED, SRF, IRF |
| Duke iAMD | Bioptigen SD-OCT | 38,300 (383 vols.) | Background, ILM-RPEDC, RPEDC-BM, sub-BM |
the quantized codes, the semantic feature field produced by . The tokenizer encoder is distinct from the stage-2 student, a more compact backbone trained from scratch (Section 2.5); because the tokenizer only emits training targets and is never deployed, we keep its encoder at full (Base) capacity without affecting the inference cost of the final model.
Encoder and forward quantization. Let denote an input B-scan, with and its height and width in pixels. The tokenizer encoder is a Vision Transformer that partitions into a regular grid of non-overlapping, square patches of side pixels, where and are the patch-grid height and width, and outputs continuous embeddings in . A linear projection then maps these embeddings to a quantization space of dimension , yielding latents , . Both the projected latents and every code are -normalized onto the unit hypersphere (the codebook is renormalized after each GNG update), so all nearest-neighbor and reconstruction computations are carried out in cosine geometry; normalization also removes codebook-magnitude bias, whereby a few high-norm codes can dominate nearest-neighbor assignment (Yu et al., 2022). Each latent is discretized by assigning it to its nearest code under the cosine distance,
and is replaced by the corresponding code, ; here is the current codebook size, which grows from to as the GNG graph introduced below expands (Section 2.6). The index is the discrete visual token of patch .
Teacher-guided reconstruction. The decoder ingests the quantized grid (the straight-through codes of Eq. (3)) and predicts, for every patch, the semantic embedding of the frozen teacher rather than raw pixels; being shallow, it maps the quantization dimension back to the embedding dimension, . Let be the teacher embedding of patch and the corresponding decoder output. The teacher feature field is spatially aligned to the encoder's grid: a teacher whose native token grid is finer than is average-pooled to match (e.g. DINOv3's tokens are pooled to ), whereas a teacher already on the grid (e.g. MIRAGE) is used directly. The tokenizer is trained to maximize the directional agreement between the two,
using the cosine distance defined in Eq. (1), so that the discrete codes are forced to retain the semantic content of the teacher representation space.
Optimization constraint. The assignment in Eq. (1) is non-differentiable. To propagate gradients from the reconstruction loss back to the encoder we use the straight-through estimator (STE; Bengio et al., 2013; van den Oord et al., 2017), copying the gradient of the quantized code directly to the latent,
where denotes the stop-gradient operator, so that equals on the forward pass but passes the gradient to the encoder on the backward pass. A commitment term keeps the encoder outputs close to the selected codes. The complete tokenizer objective is
with weighting the commitment term. Crucially, Eq. (4) contains no codebook (dictionary) loss term: the codes are never moved by gradient descent. Their values, number, and connectivity are governed entirely by the GNG procedure described next.
Codebook learning by Growing Neural Gas. The codebook is treated as a graph , with the set of edges, in which each vertex carries a code vector and an accumulated error , and edges encode neighborhood relations between codes. The graph is initialized with a small number of vertices whose code vectors are random unit-norm vectors and no edges ( ). It is grown concurrently with encoder training: at every optimization step the current encoder latents—detached from the computation graph—are presented to the GNG as input signals, so the codebook continually tracks the evolving encoder rather than being fitted once to a frozen encoder. A signal here is a single patch latent ; every patch of every image in the batch contributes one signal, so a batch of images yields signals per step. Algorithm 1 details
Algorithm 1 Growing Neural Gas codebook update
Require: patch latents (one per patch), grouped into training batches; graph initialized with random unit-norm codes and errors
Hyperparameters:
1: for each training batch do 2: for each signal do 3: two nearest units to under Eq. (1) 4: accumulate error 5: move winner, Eq. (5) 6: for do 7: move neighbors, Eq. (6) 8: end for 9: ; -renormalize moved codes 10: create/reset edge to age 0; increment age of other edges of 11: remove edges with age and any isolated vertices 12: if signals elapsed and then 13: ; 14: create new vertex with , then -renormalize); rewire , Eq. (7) 15: ; ; 16: end if 17: end for 18: global error decay, applied once per batch after all signals in , not per signal 19: end for 20: return updated graph
the full update; all steps are applied per signal except the error decay, which is applied once per training batch; we summarize its three key ideas below.
The winner and runner-up are found with the same nearest-neighbor computation as in Eq. (1). Winner/neighbor movement: rather than updating only the assigned code, as in exponential-moving-average vector quantization, GNG relocates the winner together with all of its topological neighbors toward the signal,
with adaptation rates and the graph neighbors of the winner. Edge creation: competitive Hebbian learning links codes that jointly win for the same signal and prunes edges older than (with any resulting isolated vertices); because all vectors have unit norm, , so adjacency in reflects proximity in the cosine metric used for tokenization. Vertex insertion: each winner accumulates its quantization error (Algorithm 1), and every signals a new unit is inserted between the highest-error vertex u and its highest-error neighbor f,
with keeping the same pair from being selected again immediately; all errors additionally decay by the factor once per training batch, biasing growth toward persistently poorly modeled regions. Insertion stops once the budget is reached, while movement, edge updates, and pruning continue.
2.5. Masked image modeling with GNG graph guidance
After stage 1 has converged, the tokenizer encoder, the codebook C, and its graph G are frozen, and the decoder is discarded. The second stage then pretrains the student by masked image modeling (MIM): the frozen tokenizer supplies the discrete target tokens of each B-scan via Eq. (1), and G supplies the topological prior for the soft targets. We build directly on the BEiT-2 framework (Peng et al., 2023) and inherit its two defining components: patch-wise prediction of VQ-KD codebook indices at masked positions, and a patch-aggregation branch that concentrates global information in the class token. Our contribution enters through the training signal rather than the architecture: instead of regressing each masked patch to a single ground-truth code under a flat one-hot objective, we replace the one-hot target with a soft target distribution derived from the GNG adjacency graph learned in stage 1, so that supervision is graded by topological proximity within the code vocabulary. Every other element of the pipeline follows BEiT-2 (see Fig. 1-B).
Input corruption and masking. Following BEiT-2 (Peng et al., 2023), each B-scan is augmented once, producing a single view that is shared identically by both streams: it is passed, unmasked, to the frozen tokenizer to generate the target token grid, and separately patch-embedded into the same patch grid used by the tokenizer, producing patch embeddings for the backbone. A block-wise mask (Peng et al., 2023) draws contiguous rectangular blocks until roughly 40% of the grid (about 102 of the 256 patches) is selected, defining the masked index set . Each embedding is then corrupted by a single learnable mask token ,
so that only masked positions are overwritten. A learnable class token is prepended, giving the length- input sequence that is fed to the ViT. Position is encoded by a shared relative position bias added to every attention map, in place of absolute position embeddings.
Prediction pipeline and patch-level objective. The corrupted sequence is processed by the ViT backbone, whose internal blocks we treat as a standard black box; let denote the final-layer hidden state of patch . A lightweight prediction head—a single fully-connected layer —maps each masked patch state to a categorical distribution over the active codes of the frozen codebook,
Writing for the code index emitted by the frozen tokenizer at patch (Eq. (1)), the standard BEiT-2 objective is the one-hot cross-entropy evaluated only at masked positions,
Equation (10) is our baseline and the departure point for the graph-guided target introduced next.
GNG graph-distance soft targets. A one-hot target treats every incorrect code as equally wrong, discarding the fact that the stage-1 codebook is not a flat set but a graph: competitive Hebbian edges connect codes that jointly win for nearby latents (Section 2.4), so adjacency in G reflects local proximity in the learned quantization space. We exploit this relational structure by softening the target according to graph geodesic distance. Let be the shortest-path (hop) distance between codes a and b in , with for codes lying in different connected components. For a ground-truth code we define the soft target
where the temperature controls how quickly probability mass decays with graph distance, and the indicator restricts support to an -hop neighborhood ( ): codes farther than hops, or in a disconnected component, receive zero mass by construction, and an isolated code falls back to the one-hot target. Because is fixed after stage 1, the full geodesic-distance matrix is precomputed once by breadth-first search and converted to the soft-target matrix , whose row is Eq. (11); is cached and simply looked up for every masked patch. The patch-level objective then becomes a soft cross-entropy,
which recovers the one-hot loss of Eq. (10) exactly as . In effect the backbone is penalized less for confusing a code with its topological neighbors, and the gradient is graded by distance in the learned code graph, with the aim of transferring the relational structure of the vocabulary into the representation.
Global aggregation and unified objective. Optimizing Eq. (12) alone supervises patch-level (local) predictions and leaves the class token—on which downstream image-level tasks rely—weakly constrained, the “global representation bottleneck” identified in BEiT-2 (Peng et al., 2023). We adopt its patch-aggregation remedy unchanged. Patch tokens taken from an intermediate layer (with for the ViT-B backbone), , are concatenated with the final-layer class token into the sequence
which is passed through a shallow two-layer transformer decoder to yield a second set of masked-patch predictions through the same shared head of Eq. (9). These predictions are supervised by the identical graph-distance soft targets, giving a global soft cross-entropy of the same form as Eq. (12). The two heads are trained jointly under the unified objective
Because the intermediate patch tokens in Eq. (13) can influence the prediction only through the single summarizing class token, the shallow decoder acts as an information bottleneck that forces a complete, decodable image representation into . This decoder, like the prediction heads, is discarded after pretraining, and only the backbone weights are retained for the downstream tasks. The ablation in Section 3.3 isolates the graph term by replacing Q with the identity matrix, which recovers the one-hot objective of Eq. (10) while leaving all other settings unchanged.
2.6. Implementation details
All models were implemented in PyTorch (Paszke et al., 2019), with the ViT (Dosovitskiy et al., 2021) backbones and standard training utilities built on the timm library (huggingface.co/docs/timm); downstream metrics were computed with scikit-learn (scikit-learn.org) and, for the Hausdorff distance, with MONAI (Cardoso et al., 2022). Across every stage and task, the input B-scan is resized to pixels and min-max normalized to ; with a patch size of 32 this yields the common patch grid used by the tokenizer, the backbone, and all decoders; DINOv3 uses a patch size of tokens), whose features are mapped to the common grid by average pooling. Both teachers are Base variants (MIRAGE-Base and DINOv3-Base, ), and unless otherwise noted all encoders are 12-layer ViTs with , 12 heads, and MLP ratio 4.
Visual tokenizer (VQ-KD) pretraining. The decoder Dec is a shallow 3-layer ViT. The tokenizer encoder Enc is randomly initialized and trained from scratch, supervised only by the frozen teacher's features, without inheriting the teacher's weights. A separate tokenizer is trained for each teacher on the full pretraining corpus (all 383 volumes, 38,300 B-scans) without a held-out validation split, as in BEiT-2 (Peng et al., 2023); the reconstruction loss converged stably. The codebook budget and dimension were selected jointly on a held-out subset of Kermany's official training data, independent of its test set (Supplementary Table 2). The commitment weight is , and the GNG graph grows from seed vertices to codes via a vectorized implementation of the GNG update (Orts-Escolano et al., 2015). The encoder and decoder are optimized with Adam at a base learning rate of for 45 epochs with a batch size of 128; full hyperparameters are listed in Supplementary Table 1. Both learned graphs formed a single connected component without isolated nodes, and the DINOv3-derived graph was markedly denser than the MIRAGE-derived one (5,737 vs. 1,534 undirected edges; mean node degree 22.41 vs. 5.99).
Masked image modeling (MIM) pretraining. Stage 2 pretrains two student backbones, ViT-S (D = 384, 6 heads, otherwise the default architecture) and ViT-B, on the same corpus, with the masking and aggregation branch of Section 2.5 (intermediate layer l = 9) and the augmentation recipe of the tokenizer (horizontal flip, affine warp, and intensity jitter). The soft targets use and , set once from a sensitivity sweep over and on the official Kermany test split with the GNG-ViT-Small-MIRAGE configuration and applied unchanged to every model and dataset (Supplementary Table 3). Optimization uses AdamW with a peak learning rate of , a batch size of 128, and 180 epochs; full hyperparameters are listed in Supplementary Table 1.
Downstream segmentation and classification. Segmentation was evaluated on Duke iAMD (4 classes: background plus the ILM-RPEDC, RPEDC-BM, and sub-BM regions) and AROI (8 classes following Morano et al. (2025): background above the ILM; four anatomical regions, ILM-IPL/INL, IPL/INL-RPE, RPE-BM, and sub-BM; and three lesion classes, PED, SRF, and IRF (labeled "cyst" in the dataset), with one patient excluded for annotation inconsistency and only the annotated B-scans retained). For each dataset, a patient-level stratified split with seed 42 allocated approximately 70%/10%/20% of patients to train/validation/test: 17/2/4 patients for AROI after exclusion and 269/38/76 patients for Duke iAMD segmentation. The ViT encoder is kept frozen throughout and feeds a ConvNeXt segmentation decoder (Liu et al., 2022; Bachmann et al., 2022), following Morano et al. (2025) to ensure a fair comparison with the MIRAGE baseline; only the decoder was trained, using a combined cross-entropy and Dice loss. Full segmentation optimization hyperparameters (optimizer, learning rate, batch size, augmentation, checkpoint selection, and early stopping) are listed in Supplementary Table 1.
For classification we followed the linear-probing protocol of Morano et al. (2025): the pretrained encoder is frozen, and only a single linear layer with a softmax activation is trained on top with a cross-entropy loss and label smoothing of 0.1 (full hyperparameters in Supplementary Table 1). Kermany, which is distributed as individual B-scans rather than volumes, is used in full with its official author-provided train/validation/test split, the validation subset serving only for early stopping. For Duke iAMD, a patient-level stratified split with seed 42 allocated approximately 70%/10%/20% of subjects to train/validation/test (267/39/77 subjects); for OLIVES, a label-stratified patient-level split (seed 42) allocated 60/9/18 patients (1,134/176/284 volumes). All downstream experiments ran on a single NVIDIA GeForce RTX 4090 GPU (24 GB) with 128 GB of system RAM.
2.7. Evaluation metrics
Following Morano et al. (2025), downstream classification performance was quantified using AUROC (one-vs-rest, weighted by the number of positive samples per class; Provost and Domingos, 2000; Fawcett, 2006), average precision (AP, analogously weighted), and balanced accuracy (BAcc, the mean of the per-class recall values; Mosley, 2013). Each classification model was trained with five random seeds, which vary only the linear probe's weight initialization and mini-batch order while the frozen encoder and the data split stay fixed; we report the mean and standard deviation of each metric across the five runs. For the graph-component ablation (Section 3.3), statistical significance between each GNG variant and its matched OneHot baseline of the same backbone size was assessed with a paired, two-tailed Student's t-test across the five matched seeds, with differences considered nominally significant at p < 0.05 before correction. Because this ablation involves 18 simultaneous comparisons (three metrics × three datasets × two backbone sizes), we additionally applied a Benjamini–Hochberg false-discovery-rate correction (BH-FDR) across all 18 tests, reporting three significance tiers (q < 0.05, q < 0.01, q < 0.001); BH-FDR was preferred over a family-wise correction because the tests are correlated and the ablation is exploratory. Significance markers in Table 6 reflect this correction. Because each reported GNG and OneHot encoder comes from a single pretraining run, these tests quantify probe-level variability conditional on that run and do not estimate variability arising from pretraining stochasticity (e.g. the random GNG seed vertices, signal presentation order, and insertion timing). Segmentation accuracy was quantified using the Dice coefficient, intersection-over-union (IoU), and the 95th-percentile Hausdorff distance (HD95), following Morano et al. (2025).
For each dataset, the models were trained to segment all available classes simultaneously: on AROI this comprised both retinal layers and lesions, whereas Duke iAMD contained retinal layer annotations only. Each segmentation model was trained once; the reported standard deviations describe patient-level variability. Dice, IoU, and HD95 were computed for each foreground class on every B-scan and averaged over the B-scans of each patient; HD95 is reported in in-plane pixels. Background was excluded from the reported metrics, and undefined scores were excluded from averaging. For group-level reporting, class scores were averaged within each patient, separately for layers and lesions where applicable, before calculating the reported means and standard deviations across patients. As in Morano et al. (2025), the sub-BM region is treated as a layer class in both datasets and is therefore included in the layer-level metrics.
3. Results
3.1. Ocular disease classification
After self-supervised pretraining on Duke iAMD, we transferred each MIM encoder to three downstream OCT classification benchmarks—Kermany, Duke iAMD, and OLIVES—and report area under the ROC curve (AUROC), average precision (AP), and balanced accuracy (BAcc) in Table 2. We compare our distilled models, GNG-ViT (Base and Small), against their respective teachers, MIRAGE and DINOv3 (both teachers are Base). All encoders were kept frozen; only a single linear layer was trained on top of the extracted representations (linear probing; Morano et al., 2025).
The compressed GNG-ViT-Small-MIRAGE, with roughly one-quarter of the teacher's parameters, exceeded MIRAGE in 7 of 9 dataset-metric comparisons—all three metrics on both Duke iAMD and OLIVES (e.g. OLIVES BAcc 95.22 → 98.06) and AP on Kermany—and stayed close on Kermany AUROC and BAcc (98.33 vs. 98.48; 84.30 vs. 85.32). The same-size GNG-ViT-Base-MIRAGE exceeded MIRAGE in all 9, most clearly on four-class Kermany (BAcc 85.32 → 89.98), so that distillation with the MIRAGE teacher improved on it in 16 of 18 comparisons overall.
When distilled from DINOv3, GNG-ViT achieved some of the strongest results on Duke iAMD and OLIVES. GNG-ViT-Small-DINOv3 obtained the highest balanced accuracy on Duke iAMD (93.05 vs. 90.69 for DINOv3), and GNG-ViT-Base-DINOv3 the highest AUROC and AP on OLIVES (99.74 and 99.82), although neither surpassed DINOv3 on Kermany. Beyond mean performance, distillation also reduced linear-probe variability conditional on the fixed pretrained encoder: on Duke iAMD, the balanced-accuracy standard deviation across probe seeds fell from (DINOv3) to (GNG-ViT-Small-DINOv3).
3.2. Segmentation of retinal layers and lesions
We next evaluated the pretrained MIM encoders on two structural OCT segmentation benchmarks—AROI (Melinščak et al., 2021) and Duke iAMD (Farsiu et al., 2014)—reporting Dice, intersection over union (IoU), and the 95th-percentile Hausdorff distance (HD95) in Table 3. In all experiments the encoder was kept frozen and only the segmentation decoder was trained, directly assessing the quality of the pretrained representations (Morano et al., 2025). For AROI we separate retinal-layer targets from focal lesions, as the two differ markedly in size and class balance. Representative examples for each dataset are shown in Fig. 2.
The benefit of distillation was clearest relative to the DINOv3 teacher. On AROI retinal layers, GNG-ViT-Small-DINOv3 raised Dice from 83.76 to 89.03 and IoU from 75.83 to 82.58, while the same pattern held on Duke iAMD (Dice 85.34 → 88.34). Beyond region overlap, distillation markedly improved boundary localization: DINOv3 produced large HD95 values—8.02 ± 6.17 on AROI layers and 19.16 ± 9.07 on Duke iAMD—which GNG-ViT reduced to 1.95 ± 0.63 and 8.40 ± 5.01, respectively, a roughly two- to four-fold reduction. A similar
Table 2: Downstream classification after self-supervised pretraining on Duke iAMD. Values are mean s.d. (%). Best per column within each dataset is in bold. GNG-ViT models are distilled from the teacher named in their suffix (MIRAGE or DINOv3).
| Model | AUROC (%) | AP (%) | BAcc (%) |
|---|---|---|---|
| Kermany (4-class: CNV, DME, Drusen, Normal) | |||
| MIRAGE | |||
| GNG-ViT-Base-MIRAGE | |||
| GNG-ViT-Small-MIRAGE | |||
| DINOv3 | |||
| GNG-ViT-Base-DINOv3 | |||
| GNG-ViT-Small-DINOv3 | |||
| Duke iAMD (2-class: Control vs. iAMD) | |||
| MIRAGE | |||
| GNG-ViT-Base-MIRAGE | |||
| GNG-ViT-Small-MIRAGE | |||
| DINOv3 | |||
| GNG-ViT-Base-DINOv3 | |||
| GNG-ViT-Small-DINOv3 | |||
| OLIVES (2-class: DME vs. DR) | |||
| MIRAGE | |||
| GNG-ViT-Base-MIRAGE | |||
| GNG-ViT-Small-MIRAGE | |||
| DINOv3 | |||
| GNG-ViT-Base-DINOv3 | |||
| GNG-ViT-Small-DINOv3 | |||
reduction was observed for lesion boundaries on AROI, where HD95 fell from 48.88 (DINOv3) to 35.74 (GNG-ViT-Base-DINOv3).
Distillation from the MIRAGE teacher preserved its already strong layer segmentation and improved lesion delineation. Notably, GNG-ViT-Small-MIRAGE remained within less than one Dice point of the MIRAGE teacher on retinal layers for both datasets (AROI: -0.49; Duke iAMD: -0.64), nearly reproducing its layer segmentation despite the reduced model size. GNG-ViT-Base-MIRAGE trailed by a slightly larger margin (-1.30 and -1.04, respectively) with comparable AROI layer boundary error (HD95 3.18 vs. 2.89 for MIRAGE).
On the harder AROI lesion targets, GNG-ViT-Base-MIRAGE achieved the best Dice and IoU in Table 3 (51.13 and 42.16), while GNG-ViT-Small-MIRAGE also surpassed the MIRAGE teacher (48.75 and 40.28 vs. 46.29 and 38.66), indicating that the results are consistent with a benefit of distillation on lesion delineation for both model sizes.
The qualitative examples in Fig. 2 support these quantitative comparisons.

Figure 2: Examples of segmentations from different models. The examples belong to (A) AROI and (B) Duke iAMD. True positives are depicted in the grayscale value of the class; false background pixels (missed layer), in red; false layer pixels (spurious), in yellow; and true but wrongly classified pixels (wrong class, right region), in violet. In these examples, distillation with GNG reduces the segmentation errors of the DINOv3 teacher: on AROI, DINOv3 misclassifies a large fraction of the neurosensory retina as the wrong layer (extensive violet region), an error that is markedly reduced in GNG-Base-DINOv3 and nearly resolved in GNG-Small-DINOv3; on Duke iAMD, DINOv3 exhibits a pronounced false-background strip along the scan edge (red), which is likewise suppressed after distillation. In contrast, MIRAGE and its GNG-distilled variants (GNG-Base-MIRAGE, GNG-Small-MIRAGE) produce visually similar segmentations across both datasets, limited to minor violet boundary slivers, in line with their closely matched quantitative performance.
3.3. Ablation study
To dissect the sources of the downstream performance reported above, we conducted two complementary ablations. First, we isolated the contribution of the teacher alone by evaluating the frozen stage-1 tokenizer encoder as a feature extractor without any stage-2 MIM pretraining, on both classification and segmentation. We then isolated the contribution of the graph-based component by comparing each GNG-ViT model against a matched variant in which that component is replaced by standard one-hot targets (OneHot), with the MIRAGE teacher and all other settings held fixed in both ablations. The OneHot comparison isolates the contribution of the soft graph-distance target within a fixed GNG-learned codebook.
Role of the teacher. Before isolating the graph component, we first asked how much of the downstream performance can be attributed to the choice of teacher alone, independent of the second-stage MIM pretraining. To this end we evaluated the frozen stage-1 tokenizer encoder directly—i.e. without any stage-2 distillation into a student backbone—as a feature extractor, under the same linear-probing (Kermany) and frozen-encoder, decoder-only (AROI, ConvNeXt decoder) protocols used elsewhere (Tables 4 and 5). Both tokenizers grew from the same seed vertices to the same budget codes. Both tokenizer encoders were evaluated on the official Kermany test split. On Kermany classification, the tokenizer encoder distilled from DINOv3 outperformed
Table 3: Downstream segmentation after self-supervised pretraining on Duke iAMD. The encoder was frozen and only the decoder was trained. Values are mean patient-level s.d. (%; HD95 in pixels), based on a single training run per model. Best per column within each panel is in bold. higher is better; lower is better.
| Model | Dice (%)↑ | IoU (%)↑ | HD95↓ |
|---|---|---|---|
| AROI - retinal layers | |||
| MIRAGE | 90.30 ± 1.43 | 84.40 ± 1.82 | 2.89 ± 1.52 |
| GNG-ViT-Base-MIRAGE | 89.00 ± 1.80 | 82.90 ± 0.83 | 3.18 ± 2.42 |
| GNG-ViT-Small-MIRAGE | 89.81 ± 1.54 | 83.76 ± 1.89 | 1.79 ± 1.34 |
| DINOv3 | 83.76 ± 1.22 | 75.83 ± 1.05 | 8.02 ± 6.17 |
| GNG-ViT-Base-DINOv3 | 88.47 ± 1.85 | 82.11 ± 2.12 | 2.58 ± 2.28 |
| GNG-ViT-Small-DINOv3 | 89.03 ± 1.19 | 82.58 ± 1.27 | 1.95 ± 0.63 |
| AROI - lesions (PED, SRF, IRF) | |||
| MIRAGE | 46.29 ± 6.71 | 38.66 ± 7.27 | 35.44 ± 19.57 |
| GNG-ViT-Base-MIRAGE | 51.13 ± 17.46 | 42.16 ± 17.33 | 36.18 ± 15.52 |
| GNG-ViT-Small-MIRAGE | 48.75 ± 18.95 | 40.28 ± 17.41 | 35.08 ± 19.78 |
| DINOv3 | 37.15 ± 16.58 | 28.49 ± 13.92 | 48.88 ± 37.89 |
| GNG-ViT-Base-DINOv3 | 41.19 ± 6.84 | 33.10 ± 7.64 | 35.74 ± 17.78 |
| GNG-ViT-Small-DINOv3 | 42.05 ± 22.40 | 34.36 ± 21.16 | 37.05 ± 17.40 |
| Duke iAMD - retinal layers | |||
| MIRAGE | 89.51 ± 2.86 | 82.67 ± 4.10 | 7.74 ± 4.95 |
| GNG-ViT-Base-MIRAGE | 88.47 ± 2.94 | 80.82 ± 4.27 | 8.65 ± 5.23 |
| GNG-ViT-Small-MIRAGE | 88.87 ± 2.81 | 81.33 ± 4.13 | 8.43 ± 5.27 |
| DINOv3 | 85.34 ± 2.86 | 76.60 ± 4.06 | 19.16 ± 9.07 |
| GNG-ViT-Base-DINOv3 | 87.80 ± 3.23 | 79.98 ± 4.63 | 9.38 ± 5.73 |
| GNG-ViT-Small-DINOv3 | 88.34 ± 2.62 | 80.84 ± 3.85 | 8.40 ± 5.01 |
its MIRAGE counterpart across all three metrics (AUROC 76.73 → 90.64, AP 58.33 → 77.95, BAcc 49.28 → 58.06)—the same ordering observed between the uncompressed teachers in Table 2. On AROI segmentation, the ranking reversed: the MIRAGE-derived tokenizer encoder outperformed the DINOv3-derived one on every metric, for both retinal layers (Dice 85.88 vs. 84.15, IoU 77.64 vs. 75.61, HD95 5.58 vs. 7.72) and lesions (Dice 30.66 vs. 26.25, IoU 23.50 vs. 20.68, HD95 58.53 vs. 69.74). Notably, both tokenizer encoders lag far behind the corresponding full pipelines: on Kermany, even the stronger DINOv3-derived tokenizer encoder (BAcc 58.06) trails every GNG-ViT student and both full teachers (BAcc ≥ 81.57, Table 2); on AROI lesions, the MIRAGE-derived tokenizer encoder (Dice 30.66) falls well short of the MIRAGE teacher (Dice 46.29) and the GNG-ViT-MIRAGE students (Dice ≥ 48.75, Table 3). This suggests that, while the identity of the teacher already shapes performance at the tokenizer stage, most of the downstream gains reported above arise from the second-stage MIM pretraining rather than from the tokenizer encoder representation alone.
Classification. Adding the graph component significantly improved 10 of the 18 classification comparisons and significantly worsened 2, with the largest gains on the Base model and the harder benchmarks (Table 6). On four-class Kermany, GNG-ViT-Base-MIRAGE improved balanced accuracy from 73.90 to 89.98 (+16.1 points; paired, two-tailed t-test across 5 seeds, p < 0.0001), a gain that remains significant after BH-FDR correction, alongside gains in AUROC (97.58 → 99.44) and AP (94.04 → 98.56), both likewise significant after correction (Table 6). Much of this gain reflects how poorly the Base model trained under one-hot targets: OneHot-Base trailed OneHot-Small on every classification metric and dataset, most markedly in balanced accuracy on Kermany (73.90 vs. 85.13) and OLIVES (92.48 vs. 98.41). A second pretraining run of OneHot-Base showed the same deficit; this repeat serves only as a qualitative consistency check, and all reported comparisons use one pretraining run per condition. With graph-distance targets, the Base model overtook the Small one on Kermany (89.98 vs. 84.30) and narrowed the gap on OLIVES (96.78 vs. 98.06); one possible explanation is that the soft targets regularize the higher-capacity student on the small pretraining corpus. Numerical improvements were seen across all three metrics on Duke iAMD for both model sizes, but they do not all survive multiple-testing correction: AUROC and AP improved significantly for both backbone sizes, whereas the BAcc gains were not significant after correction for either size—including the Base-model BAcc gain (85.03 → 88.33), which is nominally significant uncorrected (p = 0.047) but does not survive BH-FDR correction, and the Small-model BAcc gain (e.g. 85.70 → 90.00) (Table 6). GNG-ViT-Small did not benefit from the graph component on Kermany or OLIVES balanced accuracy, but neither drop was statistically significant (Kermany p = 0.149; OLIVES p = 0.147). GNG-ViT-Small's AUROC/AP also dipped significantly vs. OneHot-Small on OLIVES (both p < 0.01), both of which remain significant after BH-FDR correction, yet still exceeded the full MIRAGE teacher despite roughly 4× fewer parameters. This pattern suggests that the graph signal may be less beneficial for the Small backbone in these settings, where the additional supervision may be harder to exploit.
Segmentation. For segmentation the graph component was associated with modest improvements in region overlap and lower boundary error (Table 7). On AROI retinal layers, GNG-ViT-Small-MIRAGE attained the best Dice (89.81) and roughly halved the boundary error relative to its OneHot counterpart (HD95 3.61 → 1.79). On Duke iAMD layers, GNG variants were slightly better than OneHot on Dice, IoU, and HD95 for both sizes. Lesion-level metrics on AROI showed high patient-level variability and showed no consistent ordering between the two variants.
Codebook capacity and soft-target hyperparameters. For the codebook-capacity sweep (Supplementary Table 2), we used a held-out subset of 968 Kermany B-scans (242 per class), sampled without replacement from the official training partition with class stratification (seed 42). These B-scans were excluded from linear-probe training, and the official test set was not used for this se-lection. Performance varied substantially across the grid (AUROC 70.26–79.93, AP 43.98–60.44, BAcc 37.42–49.77), and 512 codes with 256-dimensional vectors performed best on every metric and were adopted as our default. We separately examined the sensitivity of the GNG soft-target hyperparameters, temperature and hop radius , on the official Kermany test split (Supplementary Table 3). Sensitivity depended on the metric: AUROC ranged from 97.78 to 98.34, AP from 94.33 to 96.16, and BAcc from 79.15 to 84.30. At , and gave nearly identical BAcc (84.25 vs. 84.30); we adopted , .
Table 4: Classification performance of the frozen stage-1 tokenizer encoder alone (no stage-2 MIM pretraining; 512 codes), evaluated by linear probing on the official Kermany test split. Values are mean ± s.d. (%) over five seeds. Best per column is in bold.
| Model | AUROC (%) | AP (%) | BAcc (%) |
|---|---|---|---|
| Tokenizer encoder-MIRAGE | 76.73 ± 0.85 | 58.33 ± 1.19 | 49.28 ± 0.74 |
| Tokenizer encoder-DINov3 | 90.64 ± 0.50 | 77.95 ± 0.84 | 58.06 ± 3.06 |
Table 5: Segmentation performance of the frozen stage-1 tokenizer encoder alone (no stage-2 MIM pretraining) on AROI, with a ConvNeXt decoder trained on top of the frozen encoder (same tokenizers as Table 4). Values are mean ± patient-level s.d. (%; HD95 in pixels), based on a single training run per model. Best per column within each panel is in bold. ↑ higher is better; ↓ lower is better.
| Model | Dice (%)↑ | IoU (%)↑ | HD95↓ |
|---|---|---|---|
| AROI — retinal layers | |||
| Tokenizer encoder-MIRAGE | 85.88 ± 1.19 | 77.64 ± 1.44 | 5.58 ± 2.47 |
| Tokenizer encoder-DINov3 | 84.15 ± 1.53 | 75.61 ± 2.33 | 7.72 ± 2.65 |
| AROI — lesions (PED, SRF, IRF) | |||
| Tokenizer encoder-MIRAGE | 30.66 ± 7.42 | 23.50 ± 7.06 | 58.53 ± 26.50 |
| Tokenizer encoder-DINov3 | 26.25 ± 9.98 | 20.68 ± 9.18 | 69.74 ± 30.48 |
3.4. Inference cost
Table 8 reports inference cost at the common input. The ViT-Small students require 6.37 encoder GFLOPs per image, fewer than MIRAGE-Base (23.25) and fewer than DINov3-Base (107.52), whereas the ViT-Base students cost about as much as MIRAGE-Base (23.65). The ViT-Base students are thus not compressed (87.43M vs. 86.04M parameters) and serve as a same-size control for studying the training objective; compression claims refer to the ViT-Small students. For classification, the ViT-Small students reduced latency from 2.98 ms (MIRAGE) and 9.50 ms (DINov3) to 1.66 ms and peak memory from 347.0 and 377.7 MiB to 104.3 MiB; for segmentation, the reduction was smaller (5.59–5.61 vs. 6.98 and 13.53 ms; 1162.1 vs. 1403.2 and 1406.3 MiB) because the shared decoder dominates the cost.
Table 6: Ablation of the graph component on downstream classification (MIRAGE teacher; linear probing). Values are mean ± s.d. (%). Within each matched GNG/OneHot pair, bold indicates the significantly better result, based on a Benjamini–Hochberg false-discovery-rate correction (BH-FDR) applied jointly across all 18 tests in this table (paired, two-tailed Student's t-test across 5 seeds); *, **, and *** denote, respectively, 0.01 ≤ q < 0.05, 0.001 ≤ q < 0.01, and q < 0.001 for that test, and neither value is bold nor starred when q ≥ 0.05.
| Model | AUROC (%) | AP (%) | BAcc (%) |
|---|---|---|---|
| Kermany (4-class) | |||
| OneHot-ViT-Base-MIRAGE | 97.58 ± 0.17 | 94.04 ± 0.41 | 73.90 ± 0.94 |
| OneHot-ViT-Small-MIRAGE | 98.12 ± 0.10 | 96.10 ± 0.20 | 85.13 ± 0.90 |
| GNG-ViT-Base-MIRAGE | 99.44 ± 0.04*** | 98.56 ± 0.09*** | 89.98 ± 0.55*** |
| GNG-ViT-Small-MIRAGE | 98.33 ± 0.18 | 96.09 ± 0.38 | 84.30 ± 1.17 |
| Duke iAMD (2-class) | |||
| OneHot-ViT-Base-MIRAGE | 95.28 ± 0.86 | 96.83 ± 0.51 | 85.03 ± 2.75 |
| OneHot-ViT-Small-MIRAGE | 96.15 ± 0.40 | 97.19 ± 0.20 | 85.70 ± 2.20 |
| GNG-ViT-Base-MIRAGE | 97.09 ± 0.26* | 98.65 ± 0.13** | 88.33 ± 2.46 |
| GNG-ViT-Small-MIRAGE | 98.95 ± 0.38** | 99.54 ± 0.19*** | 90.00 ± 2.95 |
| OLIVES (2-class) | |||
| OneHot-ViT-Base-MIRAGE | 98.93 ± 0.24 | 99.22 ± 0.18 | 92.48 ± 1.68 |
| OneHot-ViT-Small-MIRAGE | 99.66 ± 0.06** | 99.76 ± 0.03** | 98.41 ± 0.33 |
| GNG-ViT-Base-MIRAGE | 99.53 ± 0.08** | 99.66 ± 0.05** | 96.78 ± 0.89* |
| GNG-ViT-Small-MIRAGE | 99.31 ± 0.07 | 99.53 ± 0.04 | 98.06 ± 0.27 |
Table 7: Ablation of the graph component on downstream segmentation (MIRAGE teacher; frozen encoder, decoder-only training). Values are mean ± patient-level s.d. (%; HD95 in pixels), based on a single training run per model. Best per column within each panel is in bold. ↑ higher is better; ↓ lower is better.
| Model | Dice (%) ↑ | IoU (%) ↑ | HD95 ↓ |
|---|---|---|---|
| AROI — retinal layers | |||
| OneHot-ViT-Base-MIRAGE | 89.00 ± 1.68 | 82.75 ± 2.09 | 3.61 ± 4.29 |
| OneHot-ViT-Small-MIRAGE | 89.01 ± 1.55 | 82.81 ± 1.72 | 3.61 ± 4.11 |
| GNG-ViT-Base-MIRAGE | 89.00 ± 1.80 | 82.90 ± 0.83 | 3.18 ± 2.42 |
| GNG-ViT-Small-MIRAGE | 89.81 ± 1.54 | 83.76 ± 1.89 | 1.79 ± 1.34 |
| AROI — lesions (PED, SRF, IRF) | |||
| OneHot-ViT-Base-MIRAGE | 47.82 ± 15.58 | 38.76 ± 14.21 | 37.74 ± 15.67 |
| OneHot-ViT-Small-MIRAGE | 50.96 ± 17.94 | 42.29 ± 17.66 | 29.94 ± 13.49 |
| GNG-ViT-Base-MIRAGE | 51.13 ± 17.46 | 42.16 ± 17.33 | 36.18 ± 15.52 |
| GNG-ViT-Small-MIRAGE | 48.75 ± 18.95 | 40.28 ± 17.41 | 35.08 ± 19.78 |
| Duke iAMD — retinal layers | |||
| OneHot-ViT-Base-MIRAGE | 88.17 ± 3.10 | 80.61 ± 4.47 | 8.89 ± 5.75 |
| OneHot-ViT-Small-MIRAGE | 88.16 ± 2.97 | 80.65 ± 4.35 | 8.99 ± 5.14 |
| GNG-ViT-Base-MIRAGE | 88.47 ± 2.94 | 80.82 ± 4.27 | 8.65 ± 5.23 |
| GNG-ViT-Small-MIRAGE | 88.87 ± 2.81 | 81.33 ± 4.13 | 8.43 ± 5.27 |
Table 8: Inference cost at input. Parameters and GFLOPs count the encoder only (one multiply-add = one FLOP). Latency (median of 300 forward passes) and peak memory were measured on one RTX 4090 at batch size 1 in FP32 (TF32 and cuDNN disabled) and include the classification head or the ConvNeXt segmentation decoder; they are setup-specific, not optimized deployment timings. Students share the cost of their backbone regardless of teacher or pretraining target. Both teachers are ViT-Base (); DINOv3 uses -pixel patches and thus processes 1,024 tokens per image, versus 256 for the patch-32 encoders, which accounts for its higher GFLOPs and latency.
| Model | Params (M) | GFLOPs | Classification | Segmentation | ||
|---|---|---|---|---|---|---|
| Latency (ms) | Memory (MiB) | Latency (ms) | Memory (MiB) | |||
| MIRAGE-Base (teacher) | 86.04 | 23.25 | 2.98 | 347.0 | 6.98 | 1403.2 |
| DINOv3-Base (teacher) | 85.67 | 9.50 | 377.7 | 13.53 | 1406.3 | |
| ViT-Base students | 87.43 | 23.65 | 3.02 | 358.8 | 6.99-7.01 | 1410.4 |
| ViT-Small students | 22.48 | 6.37 | 1.66 | 104.3 | 5.59-5.61 | 1162.1 |
4. Discussion and conclusion
We set out to determine how much of a continuous vision foundation model's downstream utility for retinal OCT survives compression into a substantially smaller network. The proposed topology-aware discrete distillation framework reduces the teacher to a roughly fourfold smaller student. Across three classification and two segmentation benchmarks spanning multiple datasets, imaging devices, and clinical tasks, the student achieved performance close to, and in some settings above, its teacher, although the magnitude and direction of the difference depended on the teacher, task, metric, and student capacity. Three observations stand out. First, most of the teacher's downstream utility survived compression: the ViT-Small MIRAGE student stayed within one Dice point of its teacher on the retinal layers of both segmentation datasets and exceeded it on every metric on the external OLIVES benchmark (balanced accuracy 98.06 vs. 95.22; Tables 2 and 3). Second, the framework delivers these results with two teachers of different training domains, both ViT-Base, consistent with the improvements arising from the distillation procedure rather than from any single backbone, and indicating that the added value of retina-specific pretraining is task-dependent. Third, the graph-distance soft cross-entropy target improved several outcomes, particularly for the Base model, and lowered retinal-layer boundary error, but its effect was task- and capacity-dependent and was neutral or adverse in some Small-model settings (Tables 6 and 7). Within our pipeline, the role of GNG is to supply the adjacency graph that defines the graph-distance targets.
Beyond compression, examining how the framework behaves across teachers of different training domains reveals its most consequential property. Two observations recur. First, the choice of teacher shapes downstream performance in a task-dependent way. At the teacher level, the natural-image DINOv3 teacher outperforms the retina-specific MIRAGE teacher on every metric on Kermany and Duke iAMD, whereas on OLIVES the two are close on AUROC and AP and MIRAGE leads on balanced accuracy (95.22 vs. 92.79); MIRAGE leads on every segmentation benchmark (Tables 2 and 3); the same split is already present at the tokenizer stage (Tables 4 and 5). This ordering broadly carries through to the distilled students, though not uniformly: on Kermany balanced accuracy, for example, the MIRAGE-distilled students lead (Table 2). These tendencies are consistent with the two pretraining objectives: DINOv3's self-distillation tends to produce globally invariant, linearly separable features well suited to image-level classification (Park et al., 2023), while MIRAGE's retina-specific pretraining confers an advantage on fine, anatomically localized structure (Morano et al., 2025). That a general-domain model should nonetheless lead or match a retina-specific one on ocular classification is in line with recent evidence that natural-image foundation models can surpass domain-specific retinal models on detection tasks driven by clear visual patterns—precisely the regime of Kermany, Duke iAMD, and OLIVES (Hou et al., 2026). Second, the more striking observation concerns the out-of-domain teacher. When DINOv3—a model not pretrained specifically on retinal data—is passed through our pipeline, the resulting student does not merely approximate its teacher on retinal-layer segmentation; it substantially outperforms it. On retinal layers, region overlap improves on both datasets, boundary error falls roughly two- to fourfold, and the teacher's failure modes—large mislabeled retinal regions and edge artifacts—are progressively suppressed after distillation (Table 3, Fig. 2). Crucially, this gain is not attributable to the discrete bottleneck alone. The stage-1 tokenizer encoder derived from DINOv3, evaluated without any second-stage pretraining, reaches only 84.15 Dice on AROI layers—essentially the raw teacher's level (Table 5). These results suggest that the gain arises largely in the second-stage MIM pretraining, which lifts performance well above the tokenizer-only level (Table 3). One possible explanation is that quantizing the teacher's continuous features against a codebook grown on retinal data may orient the targets toward retinal structure, while graph-guided MIM trains a fresh backbone to predict those codes. These results are consistent with the framework acting not simply as a smaller MIRAGE but as a pipeline that can convert a generic visual backbone into a competitive retinal one. It also bears on how much is gained by pretraining a retina-specific foundation model: the DINOv3-distilled student reaches 89.03 Dice on AROI retinal layers against 90.30 for the MIRAGE teacher (Table 3), so a general-domain backbone passed through this pipeline approaches, without matching, a model pretrained on large retinal corpora. The advantage of retina-specific pretraining is therefore task-dependent: it is small or absent for image-level classification, but persists for dense prediction, most clearly for focal lesions (Table 3).
The results are broadly consistent across student sizes, though not perfectly so. On Duke iAMD, the Small students match or exceed both their Base counterparts and the continuous teachers on AUROC and AP, and on OLIVES all four students exceed their teachers on every metric, with the Base students ahead on AUROC and AP, whereas on the larger Kermany benchmark GNG-ViT-Base-MIRAGE is the strongest distilled variant and the gap to the teacher is larger for the DINOv3-distilled students on balanced accuracy (Table 2). The graph target likewise helped most for the Base model and on the harder benchmarks, and lowered retinal-layer boundary error in all four segmentation comparisons.
(Tables 6 and 7).
At inference, only the frozen student encoder and a lightweight task head are required, and the ViT-Small student has roughly one quarter of the teacher's parameters (22M vs. 86M) and needs at least fewer encoder FLOPs (Table 8). Because latency and peak memory were measured only on a desktop GPU, these results indicate potential suitability for deployment but do not establish deployment readiness. A second, complementary advantage is data efficiency: the student's two-stage pretraining used only a single small public cohort of 383 volumes, yet it yields a backbone competitive with a teacher trained on far larger corpora. This lowers the barrier for smaller centers, which could in principle obtain a strong task-specific backbone without assembling the large, multi-source datasets that foundation-model pretraining normally requires.
Two aspects of the evaluation bear on clinical relevance. First, the benchmark tasks mirror distinctions that OCT is used to make in practice, from referral urgency, disease detection, and disease differentiation to the layer and fluid measurements that guide anti-VEGF management (Kermany et al., 2018; Flaxel et al., 2020). Second, three of the four benchmark datasets are external to the pretraining cohort: Kermany, OLIVES, and AROI were not used for the two-stage self-supervised student pretraining on Duke iAMD and were acquired at independent centers on two other devices (Spectralis and Cirrus versus Bioptigen), so the transfer reported on these three datasets is cross-site and cross-device, whereas Duke iAMD is a within-cohort, transductive evaluation (Section 2.3). Kermany was, however, used for codebook-capacity and soft-target hyperparameter selection, so OLIVES and AROI are the only benchmarks untouched by both pretraining and model selection.
Our study has five main limitations. First, the framework is evaluated on a single imaging modality, the OCT B-scan; we do not test whether the same topology-aware discretization transfers to other retinal modalities such as fundus photography or OCT angiography. Second, all of our evaluation uses retrospective, publicly available benchmarks and therefore assesses the representation offline; it is no substitute for the prospective clinical validation that any translation into practice would require. We also did not analyze performance across demographic strata such as age, sex, or ancestry: pretraining draws on four US sites, a single device, and a single dominant disease (intermediate AMD), and a distilled student may also inherit biases of its teacher. Third, on Kermany, the soft-target hyperparameters and R were selected on the official test split and applied unchanged to every model, including the Base configuration behind the +16.1-point balanced-accuracy gain; the Kermany results are therefore not an independent confirmation (Section 3.3), and our generalization claims rest on OLIVES and AROI. The codebook-capacity sweep, repeated on a held-out selection set drawn from the training partition, reselected the same configuration, and no other test set was used for any selection. Fourth, each segmentation model was trained once, following the single-run protocol of Morano et al. (2025), so the reported segmentation variability is patient-level rather than run-to-run; the AROI lesion metrics in particular carry high variance given their sparse targets and four-patient test set. Fifth, the ablations isolate the graph-distance target against a matched one-hot control, but we did not compare against conventional VQ tokenizers within the full two-stage pipeline; the ablations also include no alternative graph topology (e.g. random or k-nearest-neighbor) and no stage-wise separation of GNG quantization, graph guidance, and additional retinal MIM training (e.g. via a teacher-free student); teacher-agnosticism, moreover, was tested only with two ViT-Base teachers with D=768, so other architectures and embedding dimensions remain untested.
Several directions follow from this work. Beyond the missing controls listed above, pretraining could be scaled to multi-device, multi-disease, and multi-institution OCT data, and larger teachers and code budgets could be tested, the latter against the density of the adjacency graph that supplies the soft targets. Relating the learned codes to annotated anatomical and pathological structure could reveal whether the discrete vocabulary captures reusable primitives of retinal OCT. In conclusion, topology-aware discrete distillation compresses a vision foundation model, whether retina-specific or general-domain, into a roughly fourfold smaller retinal student that performs close to, and in some settings above, its teacher, and suggests that the added value of retina-specific pretraining is task-dependent. Beyond the OCT B-scan, the approach could serve as a general recipe for compressing medical vision foundation models.
CRediT authorship contribution statement
Ali Yavari: Conceptualization, Formal analysis, Investigation, Methodology, Software, Visualization, Writing – original draft, Writing – review & editing. Tilman Schmoll: Project administration, Supervision, Writing – review & editing. Rainer A. Leitgeb: Formal analysis, Methodology, Supervision, Visualization, Writing – review & editing. Wolfgang Drexler: Supervision, Writing – review & editing. Thomas Schlegl: Conceptualization, Formal analysis, Methodology, Visualization, Writing – review & editing.
Declaration of generative AI and AI-assisted technologies in the manuscript preparation process
During the preparation of this work, the authors used Claude (Anthropic) only to improve the language and readability of the manuscript; it was not used to generate scientific content or references. All changes were carefully reviewed and revised by the authors, who take full responsibility for the content of the published article.
Declaration of competing interest
Tilman Schmoll is an employee of Carl Zeiss Meditec AG (Oberkochen, Germany). Wolfgang Drexler and Rainer A. Leitgeb are consultants for Carl Zeiss Meditec AG and have received financial compensation. All other authors declare no conflicts of interest.
Data availability
The pretraining data and one of the downstream benchmarks in this study come from Duke iAMD, a publicly available dataset. The remaining downstream benchmarks—Kermany, OLIVES, and AROI—are also publicly available. The links to the datasets are as follows: Duke iAMD (https://people.duke.edu/~sf59/RPEDC_0phth_2013_dataset.htm); Kermany (https://data.mendeley.com/datasets/rscbjbr9sj/2); OLIVES (https://zenodo.org/records/7105232); AROI (https://ipg.fer.hr/ipg/resources/oct_image_database). No in-house or private data were used in this study.
Code availability
The code is currently maintained in a private repository and will be made publicly available under a CC BY-NC 4.0 license upon acceptance of this manuscript.
Funding
This work was supported by Carl Zeiss Meditec AG. Tilman Schmoll is employed by Carl Zeiss Meditec AG, while Wolfgang Drexler and Rainer A. Leitgeb serve as consultants for Carl Zeiss Meditec AG; their contributions are detailed in the CRediT authorship contribution statement. Beyond these contributions, Carl Zeiss Meditec AG had no involvement in the study design, data collection, data analysis or interpretation, manuscript preparation, or the decision to submit the article for publication.
References
Bachmann, R., Mizrahi, D., Atanov, A., Zamir, A., 2022. MultiMAE: Multimodal multi-task masked autoencoders, in: Proc. European Conference on Computer Vision, pp. 348–367.
Bao, H., Dong, L., Piao, S., Wei, F., 2022. BEiT: BERT pre-training of image transformers, in: International Conference on Learning Representations (ICLR).
Bengio, Y., Léonard, N., Courville, A., 2013. Estimating or propagating gradients through stochastic neurons for conditional computation. URL: https://arxiv.org/abs/1308.3432, arXiv:1308.3432.
Cardoso, M.J., Li, W., Brown, R., Ma, N., Kerfoot, E., Wang, Y., Murrey, B., Myronenko, A., Zhao, C., Yang, D., Nath, V., He, Y., Xu, Z., Hatamizadeh, A., Zhu, W., Liu, Y., Zheng, M., Tang, Y., Yang, I., Zephyr, M., Hashemian, B., Alle, S., Zalbagi Darestani, M., Budd, C., Modat, M., Vercauteren, T.,
Wang, G., Li, Y., Hu, Y., Fu, Y., Gorman, B., Johnson, H., Genereaux, B., Erdal, B.S., Gupta, V., Diaz-Pinto, A., Dourson, A., Maier-Hein, L., Jaeger, P.F., Baumgartner, M., Kalpathy-Cramer, J., Flores, M., Kirby, J., Cooper, L.A.D., Roth, H.R., Xu, D., Bericat, D., Floca, R., Zhou, S.K., Shuaib, H., Farahani, K., Maier-Hein, K.H., Aylward, S., Dogra, P., Ourselin, S., Feng, A., 2022. MONAI: An open-source framework for deep learning in healthcare. arXiv preprint arXiv:2211.02701.
Chia, M.A., Antaki, F., Zhou, Y., Turner, A.W., Lee, A.Y., Keane, P.A., 2024. Foundation models in ophthalmology. British Journal of Ophthalmology 108, 1341–1348. doi:10.1136/bjo-2024-325459.
Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., Houlsby, N., 2021. An image is worth words: Transformers for image recognition at scale, in: Proc. International Conference on Learning Representations.
Farsiu, S., Chiu, S.J., O'Connell, R.V., Folgar, F.A., Yuan, E., Izatt, J.A., Toth, C.A., 2014. Quantitative classification of eyes with and without intermediate age-related macular degeneration using optical coherence tomography. Ophthalmology 121, 162–172. URL: https://www.sciencedirect.com/science/article/pii/S016164201300581X, doi:10.1016/j.ophtha.2013.07.013. dataset available from Duke Vision and Image Processing (VIP) Laboratory.
Fawcett, T., 2006. An introduction to ROC analysis. Pattern Recognition Letters 27, 861–874. doi:10.1016/j.patrec.2005.10.010.
Fazekas, B., Lachinov, D., Aresta, G., Mai, J., Schmidt-Erfurth, U., Bogunović, H., 2023. Segmentation of Bruch's membrane in retinal OCT with AMD using anatomical priors and uncertainty quantification. IEEE Journal of Biomedical and Health Informatics 27, 41–52. doi:10.1109/JBHI.2022.3217962.
Flaxel, C.J., Adelman, R.A., Bailey, S.T., Fawzi, A., Lim, J.I., Vemulakonda, G.A., Ying, G.s., 2020. Age-related macular degeneration preferred practice pattern®. Ophthalmology 127, P1–P65. doi:10.1016/j.ophtha.2019.09.024.
Fritzke, B., 1995. A growing neural gas network learns topologies, in: Tesauro, G., Touretzky, D.S., Leen, T.K. (Eds.), Advances in Neural Information Processing Systems, MIT Press, Cambridge, MA. pp. 625–632.
He, K., Chen, X., Xie, S., Li, Y., Dollár, P., Girshick, R., 2022. Masked autoencoders are scalable vision learners, in: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 16000–16009.
He, Y., Carass, A., Liu, Y., Jedynak, B.M., Solomon, S.D., Saidha, S., Calabresi, P.A., Prince, J.L., 2021. Structured layer surface segmentation for retina
OCT using fully convolutional regression networks. Medical Image Analysis 68, 101856. doi:10.1016/j.media.2020.101856.
Hou, Q., Zhou, Y., Goh, J.H.L., Zou, K., Yew, S.M.E., Srinivasan, S., Wang, M., Lo, T.W.S., Lei, X., Wagner, S.K., Chia, M.A., Yang, G.D., Jiang, H., Ran, A.R., Santos, R., Somfai, G.M., Zhou, J.H., Chen, H., Chen, Q., Cheung, C.Y., Keane, P.A., Tham, Y.C., 2026. Can a natural image-based foundation model outperform a retina-specific model in detecting ocular and systemic diseases? Ophthalmology Science 6, 100923. doi:10.1016/j.xops.2025.100923.
Jin, K., Yu, T., Ying, G.s., Ge, Z., Li, K.Z., Zhou, Y., Shi, D., Wang, M., Goktas, P., Grzybowski, A., 2026. A systematic review of vision and vision-language foundation models in ophthalmology. Advances in Ophthalmology Practice and Research 6, 8–19. doi:10.1016/j.aopr.2025.10.004.
Kermany, D., 2018. Labeled optical coherence tomography (OCT) and chest X-ray images for classification. Mendeley Data. URL: https://data.mendeley.com/datasets/rscbjbr9sj/2.
Kermany, D.S., Goldbaum, M., Cai, W., Valentim, C.C.S., Liang, H., Baxter, S.L., McKeown, A., Yang, G., Wu, X., Yan, F., Dong, J., Prasadha, M.K., Pei, J., Ting, M.Y.L., Zhu, J., Li, C., Hewett, S., Dong, J., Ziyar, I., Shi, A., Zhang, R., Zheng, L., Hou, R., Shi, W., Fu, X., Duan, Y., Huu, V.A.N., Wen, C., Zhang, E.D., Zhang, C.L., Li, O., Wang, X., Singer, M.A., Sun, X., Xu, J., Tafreshi, A., Lewis, M.A., Xia, H., Zhang, K., 2018. Identifying medical diagnoses and treatable diseases by image-based deep learning. Cell 172, 1122–1131.e9. doi:10.1016/j.cell.2018.02.010.
Liu, Z., Mao, H., Wu, C.Y., Feichtenhofer, C., Darrell, T., Xie, S., 2022. ConvNeXt: A ConvNet for the 2020s, in: Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11970–11980.
Melinščak, M., Radmilović, M., Vatavuk, Z., Lončarić, S., 2021. Annotated retinal optical coherence tomography images (AROI) database for joint retinal layer and fluid segmentation. Automatika 62, 375–385. URL: https://doi.org/10.1080/00051144.2021.1973298, doi:10.1080/00051144.2021.1973298.
Morano, J., Fazekas, B., Sükei, E., Fecso, R., Emre, T., Gumpinger, M., Faustmann, G., Oghbaie, M., Schmidt-Erfurth, U., Bogunović, H., 2025. Multimodal foundation model and benchmark for comprehensive retinal OCT image analysis. npj Digital Medicine 8, 576. doi:10.1038/s41746-025-01852-3.
Mosley, L., 2013. A balanced approach to the multi-class imbalance problem. PhD thesis. Iowa State University of Science and Technology.
van den Oord, A., Vinyals, O., Kavukcuoglu, K., 2017. Neural discrete representation learning, in: Advances in Neural Information Processing Systems, pp. 6306–6315.
Orts-Escolano, S., Garcia-Rodriguez, J., Serra-Perez, J.A., Jimeno-Morenilla, A., Garcia-Garcia, A., Morell, V., Cazorla, M., 2015. 3D model reconstruction using neural gas accelerated on GPU. Applied Soft Computing 32, 87–100. doi:10.1016/j.asoc.2015.03.042.
Park, N., Kim, W., Heo, B., Kim, T., Yun, S., 2023. What do self-supervised vision transformers learn?, in: International Conference on Learning Representations (ICLR).
Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Kopf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J., Chintala, S., 2019. PyTorch: An imperative style, high-performance deep learning library, in: Advances in Neural Information Processing Systems, pp. 8026–8037.
Peng, Z., Dong, L., Bao, H., Ye, Q., Wei, F., 2023. BEiT v2: Masked image modeling with vector-quantized visual tokenizers, in: The Eleventh International Conference on Learning Representations (ICLR).
Phuong, M., Lampert, C.H., 2019. Towards understanding knowledge distillation, in: Proceedings of the 36th International Conference on Machine Learning, PMLR. pp. 5142–5151.
Prabhushankar, M., Kokilepersaud, K., Logan, Y.y., Trejo Corona, S., Al-Regib, G., Wykoff, C., 2022. OLIVES dataset: ophthalmic labels for investigating visual eye semantics, in: Advances in Neural Information Processing Systems, Curran Associates, Inc.. pp. 9201–9216. URL: https://zenodo.org/records/7105232.
Provost, F., Domingos, P., 2000. Well-Trained PETs: Improving Probability Estimation Trees. CeDER Working Paper IS-00-04. Stern School of Business, New York University. New York.
Qiu, J., Wu, J., Wei, H., Shi, P., Zhang, M., Sun, Y., Li, L., Liu, H., Liu, H., Hou, S., Zhao, Y., Shi, X., Xian, J., Qu, X., Zhu, S., Pan, L., Chen, X., Zhang, X., Jiang, S., Wang, K., Yang, C., Chen, M., Fan, S., Hu, J., Lv, A., Miao, H., Guo, L., Zhang, S., Pei, C., Fan, X., Lei, J., Wei, T., Duan, J., Liu, C., Xia, X., Xiong, S., Li, J., Lam, K., Lo, B., Tham, Y.C., Wong, T.Y., Wang, N., Yuan, W., 2024. Development and validation of a multimodal multitask vision foundation model for generalist ophthalmic artificial intelligence. NEJM AI 1, AIoa2300221. doi:10.1056/AIoa2300221.
Ramesh, A., Pavlov, M., Goh, G., Gray, S., Voss, C., Radford, A., Chen, M., Sutskever, I., 2021. Zero-shot text-to-image generation, in: Proceedings of the 38th International Conference on Machine Learning (ICML), PMLR. pp. 8821–8831. doi:10.48550/arXiv.2102.12092.
Ren, S., Wei, F., Zhang, Z., Hu, H., 2023. TinyMIM: An empirical study of distilling MIM pre-trained models, in: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3687–3697.
Roy, A.G., Conjeti, S., Karri, S.P.K., Sheet, D., Katouzian, A., Wachinger, C., Navab, N., 2017. ReLayNet: retinal layer and fluid segmentation of macular optical coherence tomography using fully convolutional networks. Biomedical Optics Express 8, 3627–3642. doi:10.1364/BOE.8.003627.
Shi, D., Zhang, W., Yang, J., Huang, S., Chen, X., Xu, P., Jin, K., Lin, S., Wei, J., Yusufu, M., Liu, S., Zhang, Q., Ge, Z., Xu, X., He, M., 2025. A multimodal visual-language foundation model for computational ophthalmology. npj Digital Medicine 8, 381. doi:10.1038/s41746-025-01772-2.
Siméoni, O., Vo, H.V., Seitzer, M., Baldassarre, F., Oquab, M., Jose, C., Khalidov, V., Szafraniec, M., Yi, S., Ramamonjisoa, M., Massa, F., Haziza, D., Wehrstedt, L., Wang, J., Darcet, T., Moutakanni, T., Sentana, L., Roberts, C., Vedaldi, A., Tolan, J., Brandt, J., Couprie, C., Mairal, J., Jégou, H., Labatut, P., Bojanowski, P., 2025. DINOv3. arXiv:2508.10104.
Tian, Y., Krishnan, D., Isola, P., 2020. Contrastive representation distillation, in: International Conference on Learning Representations.
Touvron, H., Cord, M., Douze, M., Massa, F., Sablayrolles, A., Jégou, H., 2021. Training data-efficient image transformers & distillation through attention, in: Proceedings of the 38th International Conference on Machine Learning (ICML), PMLR. pp. 10347–10357.
Wong, W.L., Su, X., Li, X., Cheung, C.M.G., Klein, R., Cheng, C.Y., Wong, T.Y., 2014. Global prevalence of age-related macular degeneration and disease burden projection for 2020 and 2040: a systematic review and meta-analysis. The Lancet Global Health 2, e106-e116. doi:10.1016/S2214-109X(13)70145-1.
Yu, J., Li, X., Koh, J.Y., Zhang, H., Pang, R., Qin, J., Ku, A., Xu, Y., Baldridge, J., Wu, Y., 2022. Vector-quantized image modeling with improved VQGAN, in: International Conference on Learning Representations. URL: https://openreview.net/forum?id=pfNyExj7z2.
Zhou, Y., Chia, M.A., Wagner, S.K., Ayhan, M.S., Williamson, D.J., Struyven, R.R., Liu, T., Xu, M., Lozano, M.G., Woodward-Court, P., Kihara, Y., UK Biobank Eye & Vision Consortium, Altmann, A., Lee, A.Y., Topol, E.J., Denniston, A.K., Alexander, D.C., Keane, P.A., 2023. A foundation model for generalizable disease detection from retinal images. Nature 622, 156–163. doi:10.1038/s41586-023-06555-x.
Zhou, Y., Wang, Z., Wu, Y., Ong, A.Y., Wagner, S.K., Ruffell, E., Chia, M.A., Guan, Z., Ju, L., Engelmann, J., Merle, D.A., Li, T., Shu, J., Nderitu, P., Zou, K., Goh, J.H.L., Hou, Q., Liu, X., Wang, Y., Tham, Y.C., Altmann, A.,
Cheung, C.Y., Alexander, D.C., Topol, E.J., Denniston, A.K., Wong, T.Y., Sheng, B., Keane, P.A., 2026. Understanding pre-training data effects in retinal foundation models using two large fundus cohorts. Nature Communications 17, 3309. URL: https://doi.org/10.1038/s41467-026-70077-z, doi:10.1038/s41467-026-70077-z.