Skip to Content
  • Article
  • Open Access

28 September 2026

16 Pages

Comparing Clinical Metadata Fusion Strategies for Diabetic and Hypertensive Retinopathy Classification

,
,
,
,
and
1
Graduate Program in Biomedical Engineering, Faculty of Sciences and Technologies in Engineering, University of Brasília, Setor Leste Projeção A, Gama Leste, Brasília 72444-240, DF, Brazil
2
Graduate Program in Medical Sciences, Faculty of Medicine, University of Brasília, Campus Universitário Darcy Ribeiro, Asa Norte, Brasília 70910-900, DF, Brazil
3
Institute for Health Assessment and Translation for Chronic and Neglected Diseases of High Relevance (IATS-CARE), Belo Horizonte 31270-901, MG, Brazil
4
Laboratory of Epidemiology, Faculty of Medicine, University of Brasília, Campus Universitário Darcy Ribeiro, Asa Norte, Brasília 70910-900, DF, Brazil

Abstract

Structured clinical variables may complement fundus photographs, but the most appropriate point at which to integrate them into a retinal foundation model remains uncertain. This study compares an image-only baseline with three strategies for adding age, sex, diabetes status and hypertension status to a DINOv3-based classifier, namely a manually encoded visual metadata patch, learned metadata tokens and late fusion by feature concatenation. DINOv3 ViT-B/16 and ViT-L/16 backbones were adapted with Low-Rank Adaptation under a matched training protocol and evaluated on three patient-wise folds of the Brazilian Multilabel Ophthalmological Dataset. The diabetic retinopathy task comprised 9531 images with 1070 positive cases and the hypertensive retinopathy task comprised 8745 images with 284 positive cases. For diabetic retinopathy with ViT-L/16, all three strategies improved the F1-score over the image-only model. Late fusion reached an ROC-AUC of 0.9943, an AUC-PR of 0.9700 and an F1-score of 0.9326; the visual patch had a similar AUC-PR and learned tokens had the highest sensitivity. For hypertensive retinopathy, late fusion had the highest mean ROC-AUC of 0.8970, AUC-PR of 0.4441 and F1-score of 0.4338, but its paired advantage over the image-only model was limited to threshold-dependent metrics. Removing the target-related systemic variable reduced the late-fusion F1-score from 0.9326 to 0.9228 for diabetic retinopathy and from 0.4338 to 0.3776 for hypertensive retinopathy, showing that part of the multimodal gain came from disease-related clinical context. Models using only clinical metadata performed substantially worse than the image-based models. Metadata integration was beneficial in several matched comparisons, but early integration was not uniformly superior and late fusion yielded the most consistently favorable mean results.

1. Introduction

Retinal fundus photographs contain vascular and structural information that can support the detection of ocular manifestations of systemic disease. Diabetic retinopathy (DR) remains an important cause of preventable visual impairment and blindness among working-age adults worldwide [1,2]. Hypertensive retinopathy (HR), also represented in real-world retinal screening datasets, is characterized by retinal findings associated with systemic hypertension. Automated analysis of fundus photographs has therefore received considerable attention as a means of supporting large-scale screening and reducing specialist workload. Earlier approaches were predominantly based on convolutional neural networks and task-specific supervised training [3].
More recently, self-supervised foundation models have substantially expanded the range of representations available for retinal image analysis. In particular, domain-specific models have demonstrated the benefits of large-scale pretraining tailored to retinal imaging. RETFound showed that self-supervised pretraining on large collections of unlabeled retinal images can yield generalizable and label-efficient representations for a variety of ocular and systemic disease prediction tasks [2]. Building on this direction, RETFound-Green demonstrated that competitive retinal representations can be learned with substantially less training data and computational resources [4]. More recent work has further examined how the composition of retinal pretraining datasets influences downstream generalizability and demographic fairness, highlighting the importance of careful data selection and curation [5]. In parallel, general-purpose foundation models have continued to improve, providing increasingly strong representations that can also be transferred to retinal imaging tasks.
Meta’s DINO family has played an important role in the development of general-purpose self-supervised visual representations. The original DINO demonstrated that Vision Transformers (ViTs) trained through self-distillation without labels can learn semantically meaningful and transferable image features [6]. DINOv2 subsequently scaled this paradigm through larger models and a large, automatically curated training dataset, yielding robust general-purpose representations that transfer effectively across image-level and dense prediction tasks [7]. More recently, DINOv3 further scaled self-supervised training while introducing strategies to preserve high-quality dense features, resulting in strong transferable representations across a broad range of visual tasks [8]. Recent evaluations in medical imaging suggest that DINOv3 representations transfer well to medical images, although its performance varies substantially across imaging modalities and downstream tasks and remains sensitive to model and backbone scale, input resolution and adaptation strategy [9,10,11].
In parallel with advances in purely visual foundation models, recent work has explored the integration of language and clinical context into retinal representation learning. These approaches aim to enrich image-based representations with semantic information that may capture disease concepts, diagnostic relationships and other clinically relevant cues. FLAIR aligns fundus images with expert-derived textual descriptions to learn vision–language representations tailored to retinal imaging [12]. EyeCLIP extends this direction across multiple ophthalmic imaging modalities by combining self-supervised, cross-modal and image–text learning objectives [13]. RetiZero similarly aligns fundus photographs with a broad set of retinal disease descriptions, supporting more semantically informed retinal representations [14]. Beyond image–text alignment, context-aware ocular models have incorporated information such as multiple images, previous diagnoses and broader clinical context [15]. Together, these studies suggest that incorporating non-visual information can complement image representations and potentially improve their clinical relevance and transferability.
Structured patient variables differ from reports and textual prompts because variables such as age, sex, diabetes status and hypertension status are typically represented as tabular attributes. One approach is to process these variables in a separate branch and concatenate the resulting representation with visual features before classification [16]. More recently, Transformer-based approaches have also represented structured clinical information as tokens, which allows the interaction with image tokens during representation learning [17]. These alternatives raise a methodological question regarding whether the stage at which structured clinical information is introduced to the pipeline consistently affects model performance.
Multimodal fusion can be categorized according to the stage at which information from different modalities is combined, typically at the input level, at intermediate feature representations or at modality-specific outputs [18,19]. For medical imaging and electronic health records, Huang et al. distinguish early fusion, in which features are concatenated at the input of a single model, joint fusion, in which the loss is also propagated to the feature extractors and late fusion, in which predictions from separate models are aggregated [20]. Structured variables can also be converted into images for convolutional networks [21,22]. Image-only retinal classification, which provides the unimodal reference for this comparison, has been extensively explored in fundus imaging [2,3,4,5].
In the present study, the visual patch embeds the clinical variables as a small encoded region within the retinal photograph, rather than generating an entire image from tabular data. The learned-token strategy inserts them into the Transformer sequence, allowing interaction with retinal image tokens during feature extraction. In late fusion, the clinical variables are encoded separately and concatenated with the final DINOv3 visual representation before classification. Here, early and late fusion are defined relative to visual feature extraction by the DINOv3 encoder, so the visual patch and learned tokens are early strategies and feature concatenation is late fusion. This nomenclature is specific to the present study. In the taxonomy defined by Huang et al. [20], the late-fusion configuration would correspond to joint fusion, because all trainable components are optimized end to end.
The Brazilian Multilabel Ophthalmological Dataset (BRSET) provides a suitable setting for this comparison. It comprises 16,266 color fundus photographs from 8524 Brazilian patients collected in real-world outpatient settings, together with demographic, clinical, anatomical and diagnostic annotations [23,24]. Images were acquired using two conventional tabletop fundus cameras and the dataset covers a broad range of retinal findings, including DR, HR, diabetic macular edema, age-related macular degeneration, among other abnormalities.
The primary objective of this study was to compare an image-only baseline with three strategies for incorporating structured clinical metadata into a DINOv3-based retinal image classification pipeline, namely a visual metadata patch, learned metadata tokens and late fusion through feature concatenation. These strategies were evaluated for DR and HR using DINOv3 Vision Transformer base (ViT-B/16) and large (ViT-L/16) backbones. To promote a matched comparison, all experiments used the same patient-wise cross-validation folds and training protocol across fusion strategies and backbone sizes, while representation-specific implementation differences are described explicitly below. The intended setting is multimodal classification when retinal images and structured patient context are jointly available at inference. The multimodal model setting should therefore not be interpreted as diagnosis based exclusively on retinal morphology. The main contributions of this study are as follows:
  • A matched comparison of three multimodal metadata-fusion strategies against image-only baselines within the same DINOv3-based classification framework.
  • An evaluation across two retinal diseases with substantially different class prevalence, enabling assessment of the fusion strategies under different levels of class imbalance.
  • An analysis of the interaction between backbone size and metadata-fusion strategy, considering discrimination, sensitivity, specificity and balanced accuracy.
  • A target-status ablation and a metadata-only baseline to estimate how much of the multimodal performance depends on the systemic variable most closely related to each disease.

2. Methods

2.1. Experimental Design

In this work, two binary classification tasks were investigated: normal fundus images versus DR and normal fundus images versus HR. For each disease, two DINOv3 backbones, ViT-B/16 and ViT-L/16, were evaluated using an image-only baseline and three metadata-fusion strategies: visual patch, learned tokens and late fusion. This resulted in eight configurations per disease and 16 configurations overall. Each configuration was evaluated using the same three patient-wise folds, yielding a total of 48 fold-level model runs.
The four strategies were as follows:
  • Image-only: The model received only the retinal image.
  • Visual patch: Metadata were encoded as colored pixels directly within the input image.
  • Learned tokens: Four metadata tokens were inserted into the Transformer sequence.
  • Late fusion: Independently encoded metadata were concatenated with the final visual representation.
Table 1 summarizes the representation and fusion point used by each strategy. The shared pipeline and the point at which each strategy introduces the clinical metadata are illustrated in Figure 1.
Table 1. Summary of the four metadata-use strategies.
Figure 1. Shared DINOv3 classification pipeline and metadata entry points. All four configurations use the same image preprocessing, DINOv3 backbone with LoRA and classification head. In the image-only configuration, clinical metadata are not used. In the visual-patch strategy (a), the metadata are converted into a fixed 32 × 32 color patch inserted after geometric augmentation and before ImageNet normalization, so they enter DINOv3 as four image patch tokens. In the learned-token strategy (b), the metadata are encoded as four trainable tokens and inserted into the token sequence before the first Transformer block, allowing self-attention with the retinal image tokens. In late fusion (c), the metadata are encoded into a 128-dimensional representation and concatenated with the normalized final CLS token after visual feature extraction.
The random seed was reset for every combination of disease, backbone, strategy and fold so that model initialization, data ordering, augmentations and dropout were independent of the experiment execution order.

2.2. Dataset and Binary Task Construction

The BRSET comprises 16,266 fundus images from 8524 patients [23,24]. From this full dataset, task-specific subsets were constructed for the DR and HR experiments. For each task, only images classified as normal or annotated with the target disease were included. An image was assigned to the normal class only when none of the available retinal findings was annotated. Images annotated with the target disease were assigned to the positive class, even when other retinal findings were also present.
The resulting DR subset contained 9531 images from 5679 patients, comprising 8461 normal images and 1070 images annotated with DR. The HR subset contained 8745 images from 5271 patients, comprising the same 8461 normal images and 284 images annotated with HR. The positive-class prevalence was therefore 11.23% for DR and 3.25% for HR. Table 2 summarizes the composition of both binary classification tasks.
Table 2. Binary task composition.
Splitting was performed at the patient level to prevent images from the same patient from appearing in more than one subset. Patients were stratified according to whether at least one of their images was positive. Three outer folds were generated. Within the development portion of each fold, approximately 15% of patients were assigned to validation using a second stratified split. All metadata normalization parameters were estimated exclusively from the training subset of the corresponding fold.

2.3. Image Preprocessing and Augmentation

All configurations used the same retinal preprocessing pipeline. Each fundus image was first resized so that its longest side did not exceed 1200 pixels. A second copy, with a maximum side of 768 pixels, was used to locate the retinal field. A foreground mask was constructed from intensity and saturation information, morphologically cleaned and reduced to its largest connected component. A minimum enclosing circle was fitted to this component and the center and radius were rescaled to the working image. A square crop with a 3% radial margin was extracted around the detected retina. Black padding was added when the crop exceeded the image limits and the result was resized to 512 × 512 pixels.
During training, each cropped image was horizontally flipped with a probability of 0.5 and randomly rotated within ± 15 ° . No data augmentation was applied to the validation or test images. All images were normalized using the ImageNet channel statistics adopted by DINOv3. For the visual-patch strategy, the metadata patch was inserted after geometric augmentation and tensor conversion, but before ImageNet normalization. This ensured that the patch location and quadrant ordering were unaffected by the geometric transformations, while its pixel values were subsequently normalized together with the rest of the image.

2.4. Clinical Metadata Preparation

Age, sex, diabetes status and hypertension status were used in all three multimodal strategies. In the diabetic retinopathy cohort, age was missing for 3566 of 9531 images (37.41%), whereas hypertension status was missing for 5196 images (54.52%). Sex and diabetes status were available for all images. In the hypertensive retinopathy cohort, age was missing for 3326 of 8745 images (38.03%), whereas hypertension status was missing for 4959 images (56.71%). Sex and diabetes status were again available for all images. Age was min–max normalized using the minimum and maximum ages observed in the training subset of each fold. An additional binary variable indicated whether age was available. Missing age values were filled with the minimum training age before normalization, yielding a normalized value of zero together with an explicit absence indicator.
For learned tokens and late fusion, sex, diabetes and hypertension were represented as three-category variables: unknown, negative or male and positive or female, as appropriate. Thus, missing categorical values were represented explicitly rather than being imputed as negative. Complete information for all four metadata variables was available for 4335 of 9531 images (45.48%) in the diabetic retinopathy cohort and for 3786 of 8745 images (43.29%) in the hypertensive retinopathy cohort. The same fold-specific metadata preparation was applied to training, validation and test subsets without using validation or test information to determine normalization parameters.
The visual-patch encoding handled missing values differently. For diabetes and hypertension, a missing value retained the same baseline quadrant used for a negative status, so missing and negative systemic-status values were not distinguishable in that representation. By contrast, learned tokens and late fusion used an explicit unknown category. This difference is relevant for HR, in which hypertension status was missing in 56.71% of images. The comparison therefore evaluates the complete fusion implementations rather than the fusion point alone.

2.5. Visual Metadata Patch

The visual patch occupied a 32 × 32 -pixel region in the upper-left corner of the augmented image and was divided into four 16 × 16 quadrants. Because DINOv3 uses 16 × 16 image patches, the metadata region generated four visual tokens. The colors and intensities were manually defined and fixed throughout training.
The upper-left quadrant encoded age: the red channel contained normalized age and the green channel was set to 3 / 4 when age was present or 1 / 4 when missing. The upper-right quadrant encoded sex: male was represented with blue intensity 1 / 2 , female with green and blue intensities 1 / 2 and missing sex with a black quadrant. The lower-left quadrant encoded diabetes: the red channel was fixed at 1 / 4 and the blue channel was set to 3 / 4 for a positive status. The lower-right quadrant encoded hypertension: the green channel was fixed at 1 / 4 and the blue channel was set to 3 / 4 for a positive status. Missing diabetes or hypertension retained the corresponding baseline quadrant. Figure 2 shows examples of the patch embedded in the preprocessed fundus image, while Figure 1, entry point (a), indicates its insertion point in the processing pipeline.
Figure 2. Examples of preprocessed fundus images containing the proposed metadata patch. The image (a) corresponds to a 71-year-old female patient without diabetes or hypertension, whereas image (b) corresponds to a 77-year-old female patient with diabetes and no hypertension. The white border highlights the patch location for visualization purposes only and is not included in the image provided to the model.

2.6. Learned Metadata Tokens

The learned-token strategy generated one token for each metadata variable, with the same hidden dimension as the selected DINOv3 backbone. Age was projected through a two-layer multilayer perceptron and combined with a learned embedding indicating whether age was available. Sex, diabetes and hypertension were represented by independent three-category embedding layers. A trainable token-type embedding distinguished the four metadata tokens, followed by layer normalization and dropout.
The resulting sequence was organized as [CLS], [register], [sex], [diabetes], [hypertension], [imagem patches]. The four metadata tokens therefore participated in self-attention from the first Transformer block. Rotary positional embeddings remained associated with the spatial image patches. Classification used the final CLS representation. More precisely, the final layer normalization was applied to the encoded sequence and the normalized token at index zero (CLS) was passed to the classifier. This fusion mechanism and the point at which metadata enter the Transformer sequence are illustrated in Figure 1, entry point (b).

2.7. Late Fusion by Feature Concatenation

Late fusion used a separate trainable metadata encoder. Normalized age and the age-availability indicator contributed two scalar inputs. Sex, diabetes and hypertension were each mapped to a 16-dimensional embedding, resulting in a 50-dimensional intermediate metadata vector. This vector was processed by a two-layer network with GELU activation and dropout to produce a 128-dimensional representation. The metadata representation was concatenated with the pooled DINOv3 image representation and passed to the classification head. The separation between visual feature extraction and metadata integration is illustrated in Figure 1, entry point (c).

2.8. DINOv3 Adaptation and Classifier

DINOv3 ViT-B/16 and ViT-L/16 served as the common visual backbones [8]. The original backbone weights were frozen and adapted using Low-Rank Adaptation (LoRA) [25]. Adapters were inserted into the q_proj, k_proj, v_proj and o_proj attention projections and the up_proj and down_proj multilayer-perceptron projections. The  LoRA rank was 16, the  scaling parameter was 32 and dropout was set to 0.05.
For image-only, visual-patch and late-fusion configurations, the pooler_output returned by the DINOv3 ViT implementation was used. This output is the normalized final CLS token, i.e, the token at sequence index zero after the model’s final layer normalization. In the learned-token configuration, the augmented sequence was passed through the same encoder and final layer normalization and the token at sequence index zero was likewise selected. Thus, all four configurations use the same normalized final-CLS aggregation rule. The only difference in the learned-token configuration is that the metadata tokens participate in self-attention before that representation is extracted. The classification head consisted of layer normalization, dropout, a linear layer, GELU activation, a second dropout layer and a two-class output layer. LoRA parameters, metadata encoders and the classification head were trainable, while the original DINOv3 weights remained frozen.

2.9. Training Protocol

All configurations followed the same optimization protocol. Models were trained for at most 50 epochs using AdamW. The learning rate was 1 × 10 − 4 for LoRA parameters and 3 × 10 − 4 for the classification head and trainable metadata modules, with weight decay 1 × 10 − 4 . A cosine annealing schedule was applied. The physical batch size was 16 and gradients were accumulated over four steps, yielding an effective batch size of 64. Gradient norm was clipped at 1.0. Automatic mixed precision used bfloat16 when supported, while model parameters were loaded in floating-point 32 format.
Training minimized class-balanced focal cross-entropy with γ = 1 [26,27]. Class weights were calculated from the training subset using effective-number weighting with β = 0.999 and normalized to have mean one. The checkpoint with the highest validation AUC-PR was retained and training stopped after seven consecutive epochs without improvement. The learning rate and all other hyperparameters were identical for DR and HR.
All experiments were conducted in Google Colab using an NVIDIA RTX PRO 6000 GPU with 96 GB of VRAM. Code and model are available at https://github.com/labviaunb/metadata (accessed on 20 September 2026).

2.10. Evaluation Protocol

Performance was measured using ROC-AUC, AUC-PR, positive-class F1-score, precision, sensitivity, specificity, balanced accuracy and accuracy. A decision threshold was selected on the validation subset by maximizing positive-class F1 and was then applied unchanged to the corresponding test subset. Reported values are the mean and population standard deviation across the three patient-wise test folds. Fold-specific 95% confidence intervals were estimated with 1000 patient-cluster bootstrap resamples. Patients, rather than individual images, were sampled with replacement and all images from a sampled patient were retained together. Intervals were calculated for ROC-AUC, AUC-PR, F1, sensitivity, specificity and balanced accuracy and are reported in Supplementary Tables S1 and S2. Each multimodal strategy was also compared with the matched image-only model using a paired patient-cluster bootstrap. Within each fold, the same resampled patients were used for both models, and the metric differences were averaged across the three folds for each of the 1000 replicates.
AUC-PR was used as the checkpoint criterion because both tasks were imbalanced, particularly HR. Only three outer folds were used and the three multimodal strategies were not formally tested against each other. Differences between these strategies are therefore reported as observed trends rather than as proof that one strategy is better. The pooled curves in Figure 3 are shown only for visualization. The main comparisons are based on the fold-level results and the paired comparisons with the image-only model.
Figure 3. Receiver operating characteristic and precision–recall curves obtained from pooled out-of-fold test predictions for the ViT-L/16 backbone. Panels (a,b) show the ROC and precision–recall curves for diabetic retinopathy, respectively, whereas panels (c,d) show the corresponding curves for hypertensive retinopathy. The dashed lines represent the random classifier baseline (AUC = 0.50) in the ROC plots and the prevalence-based baseline in the precision–recall plots. Each curve combines predictions from the three patient-disjoint test folds. Because the folds come from independently trained models, pooled AUCs can differ from the fold-averaged values in Table 3 and Table 4, which support the main comparisons.
Table 3. Diabetic retinopathy classification. Values are mean and standard deviation across three patient-wise folds. The highest mean value in each metric column is highlighted in bold.
Table 4. Hypertensive retinopathy classification. Values are mean and standard deviation across three patient-wise folds. The highest mean value in each metric column is highlighted in bold.

2.11. Target-Status Ablation and Metadata-Only Sensitivity Analyses

Diabetes status is closely related to DR and hypertension status is closely related to HR. The models could therefore use these variables as shortcuts. To assess this, an additional analysis was performed with ViT-L/16 for the three multimodal strategies. For DR, diabetes status was set to a constant unknown value in the training, validation and test subsets. For HR, hypertension status was replaced in the same manner. In both cases, the model architecture, patient-wise folds and training protocol were otherwise identical to those of the main experiments. The removed variable therefore no longer carried any information about the target disease. In the visual-patch model, the corresponding quadrant remained fixed at its baseline color. In the learned-token and late-fusion models, the variable was set to the unknown category.
A model using only the clinical metadata, without retinal images, was also evaluated on the same patient-wise folds. Missing ages were filled with the median age of the training data, a missing-age indicator was added and age was standardized. Sex, diabetes and hypertension were one-hot encoded, with a separate category for unknown values. A class-balanced logistic regression was trained on each training fold and its decision threshold was chosen on the validation fold by maximizing positive-class F1. This model was evaluated both with all metadata and with the target-related variable removed. These analyses show how much the clinical variables can predict on their own and how much of that comes from the target-related variable.

3. Results

3.1. Diabetic Retinopathy Classification

Table 3 summarizes the DR results. The pooled out-of-fold ROC and precision–recall curves for the ViT-L/16 configurations are shown in Figure 3a and Figure 3b, respectively. With ViT-B/16, the three metadata strategies yielded similar ROC-AUC and AUC-PR values. Late fusion and the visual patch both increased mean F1 from 0.9132 for image-only input to 0.9166 , while learned tokens produced the highest sensitivity and balanced accuracy for this backbone.
The effect of metadata was clearer with ViT-L/16. All three multimodal configurations increased F1 relative to the image-only baseline. Late fusion had the highest mean ROC-AUC and F1, 0.9943 ± 0.0015 and 0.9326 ± 0.0035 , respectively. The visual patch had the highest mean AUC-PR by a small margin, 0.9701 ± 0.0066 , whereas learned tokens had the highest mean sensitivity and balanced accuracy, 0.9428 ± 0.0094 and 0.9656 ± 0.0036 . In the paired patient-cluster bootstrap against image-only, the 95% interval for the F1 difference excluded zero for all three multimodal strategies, with mean F1 gains between 0.0140 and 0.0195. For AUC-PR, the interval excluded zero for visual patch and late fusion but narrowly included zero for learned tokens. The differences among the three multimodal ViT-L/16 configurations were small for threshold-independent metrics.

3.2. Hypertensive Retinopathy Classification

HR was substantially more difficult than DR, consistent with its lower positive-class prevalence. Table 4 shows greater fold-to-fold variation in F1, sensitivity and balanced accuracy. The corresponding pooled out-of-fold ROC and precision–recall curves for ViT-L/16 are shown in Figure 3c and Figure 3d, respectively. With ViT-B/16, learned tokens achieved the highest F1 and balanced accuracy, whereas late fusion produced the highest AUC-PR. The visual patch did not improve F1 over the image-only baseline.
ViT-L/16 produced higher overall HR performance. Late fusion had the highest observed mean values across several principal metrics, with an ROC-AUC of 0.8970 ± 0.0045 , an AUC-PR of 0.4441 ± 0.0267 , an F1-score of 0.4338 ± 0.0250 , a sensitivity of 0.4732 ± 0.0992 and a balanced accuracy of 0.7250 ± 0.0456 . In the paired patient-cluster bootstrap against image-only, the F1 difference was + 0.0563 , with a 95% CI of 0.0070 to 0.1049. The corresponding differences were + 0.1399 for sensitivity, with a CI of 0.0970 to 0.1820 and + 0.0640 for balanced accuracy, with a CI of 0.0427 to 0.0851. The intervals for ROC-AUC and AUC-PR included zero. Specificity decreased by 0.0119, with a CI for this decrease of 0.0088 to 0.0152. Learned tokens increased mean sensitivity but reduced specificity and F1, while the visual patch remained close to the image-only baseline.
The pooled curves in Figure 3 should not be read as fold-averaged performance estimates. For example, HR ViT-L/16 late fusion had a mean fold AUC-PR of 0.4441 compared with 0.4391 for image-only, whereas the corresponding pooled out-of-fold AUC-PR values were 0.4150 and 0.4318. This discrepancy arises from pooling scores produced by independently trained fold models and does not alter the fold-based analysis used for Table 3 and Table 4.

3.3. Target-Status and Metadata-Only Sensitivity Analyses

Table 5 summarizes the target-status ablation for ViT-L/16 and the metadata-only results. For DR, removing diabetes status led to small reductions in all three multimodal strategies. For late fusion, AUC-PR decreased from 0.9700 to 0.9642 and F1 decreased from 0.9326 to 0.9228. Even so, the three multimodal models remained close to their full-metadata versions and above the image-only F1 of 0.9131. The metadata-only model was much more affected. Its ROC-AUC decreased from 0.8609 to 0.6955 and its AUC-PR decreased from 0.4181 to 0.2052. Diabetes status therefore carried substantial predictive information, but it did not account for the high performance of the image-based models.
Table 5. Target-related systemic-status ablation and metadata-only sensitivity analysis. Values are mean ± population standard deviation across the same three patient-wise folds. “Target ablated” denotes diabetes status set to a constant unknown value for DR and hypertension status set to a constant unknown value for HR. The image-only rows are repeated from Table 3 and Table 4 for reference.
For HR, removing hypertension status had a larger effect on the F1 advantage of late fusion. Its F1 decreased from 0.4338 to 0.3776, virtually identical to the image-only F1 of 0.3775 and its AUC-PR decreased from 0.4441 to 0.4322. In contrast, the AUC-PR of learned tokens increased from 0.4204 to 0.4470 after the ablation. Because HR included only 284 positive images and showed large variation between folds, this increase is considered descriptive and is not taken as evidence that removing hypertension status improves the model. The metadata-only model performed poorly for HR, with an AUC-PR of 0.0968 using all metadata and 0.0779 after removing hypertension status.
Table 6 shows the paired patient-cluster bootstrap differences between each multimodal strategy and the image-only model for ViT-L/16. For DR, several improvements over image-only had confidence intervals that excluded zero. For HR, the advantage of late fusion was limited to threshold-dependent metrics such as F1 and was not observed for ROC-AUC or AUC-PR.
Table 6. Paired patient-cluster bootstrap comparison of ViT-L/16 multimodal strategies with the matched image-only baseline. Values are mean fold differences (multimodal minus image-only) with 95% bootstrap confidence intervals based on 1000 patient-cluster resamples. Intervals including zero indicate that the observed difference was not clearly separated from zero under this analysis.

4. Discussion

The results do not support a single fusion strategy as uniformly optimal across diseases, backbones and metrics. For DR, all three metadata strategies improved at least some ViT-L/16 metrics relative to image-only input. Late fusion produced the highest mean F1 and ROC-AUC, the visual patch produced a nearly identical and slightly higher mean AUC-PR, and learned tokens shifted the operating characteristics toward higher sensitivity and balanced accuracy. The paired bootstrap analysis supports improvements over image-only for several DR metrics but does not establish a statistically superior multimodal fusion strategy. These findings indicate that the clinical variables contained useful information, but that exposing them to early self-attention was not required to obtain favorable mean classification performance.
The visual metadata patch remained competitive for DR, particularly with the larger backbone, but its advantage was not replicated for HR. Visual encoding is therefore a viable mechanism that preserves the backbone architecture, but it should not be assumed to outperform trainable tabular fusion. The manually selected colors and intensities may constrain its ability to represent interactions efficiently and replacing a small retinal region with synthetic pixels introduces a trade-off that is absent from late fusion.
Learned metadata tokens also exhibited task-dependent behavior. For DR, they produced the highest sensitivity and balanced accuracy with ViT-L/16. For HR, however, their increased sensitivity was accompanied by reduced specificity and lower F1 than late fusion. One possible hypothesis is that the four clinical tokens inserted at the first block require more positive examples to learn stable cross-modal attention. This interpretation remains hypothetical because attention maps were not examined, although the target-status ablations provide direct evidence that dependence on the target-related variable differs between tasks and strategies.
Late fusion showed the most consistently favorable mean results across the two tasks, although the statistical analyses did not establish a clear advantage over the other multimodal strategies. It had the highest mean DR F1 and the highest mean values for several HR metrics, while requiring no modification of the internal DINOv3 token sequence. In HR, however, the paired bootstrap interval excluded zero for F1, sensitivity and balanced accuracy but not for ROC-AUC or AUC-PR. This suggests that, for the BRSET variables used here, a compact trainable tabular encoder followed by feature concatenation was sufficient to exploit much of the complementary clinical information. Simpler fusion should therefore remain a strong baseline when evaluating more complex early-integration methods.
The contrast between DR and HR is also important. DR contained 1070 positive images, whereas HR contained only 284. The lower HR AUC-PR and larger variation in threshold-dependent metrics are consistent with the much more severe imbalance and limited positive supervision. The strong specificity of several HR models should not obscure their modest sensitivity. For screening-oriented applications, the sensitivity–specificity trade-off and the precision–recall curve are more informative than accuracy alone.
The DR results remain favorable relative to the technical validation reported in the original BRSET study, which obtained an ROC-AUC of 0.97 and a macro F1-score of 0.89 using ConvNeXt V2 Large [23]. The present ViT-L/16 configurations achieved mean ROC-AUC values between 0.9925 and 0.9943 and positive-class F1 values between 0.9131 and 0.9326. This comparison is contextual rather than head-to-head because the partitioning procedures and F1 definitions differ.
Diabetes status was included as metadata for DR classification and hypertension status for HR classification. These variables are relevant patient context, but they are also closely related to the target disease and could allow the models to use them as shortcuts. The target-status ablation experiments were designed to measure this effect. For DR, removing diabetes status led to only small reductions in the multimodal models, whereas the AUC-PR of the metadata-only model decreased by about half. Diabetes status therefore carried substantial predictive information on its own, but the image-based models remained highly discriminative without it. For HR, removing hypertension status reduced the F1 of late fusion to the level of the image-only model, while its AUC-PR changed little. Part of the F1 advantage of late fusion for HR was therefore associated with hypertension status. These findings support interpreting the models as multimodal classifiers that combine retinal images with clinical context, rather than as tools for diagnosis based exclusively on retinal morphology. Disease-restricted subgroup analyses would be needed to fully separate the contributions of retinal morphology, systemic status and their interaction.
Limitations of this study include evaluation on a single dataset, absence of external validation, binary rather than severity-graded outcomes, and lack of calibration. The multimodal strategies were compared with the image-only model using paired bootstrap intervals, but they were not formally tested against each other. In addition, the visual patch does not distinguish a missing diabetes or hypertension status from a negative one, whereas learned tokens and late fusion use an explicit unknown category. This difference is particularly relevant for HR, in which hypertension status was missing for more than half of the images. As a result, the comparison does not fully isolate the effect of the fusion point. The HR task had very few positive images and no resampling or disease-specific hyperparameter optimization was performed. The visual patch was manually designed and the learned-token and late-fusion modules were evaluated with one architecture each. Finally, BRSET includes a quality marker, but inadequate-quality images were retained in the present study. This choice better reflects the variability encountered in real-world image acquisition, although it may also make the classification task more difficult.

5. Conclusions

This study compared image-only input, a visual metadata patch, learned metadata tokens and late fusion for DINOv3-based DR and HR classification. The comparison used two backbone sizes, matched patient-wise folds and an identical LoRA training protocol. For DR, all three metadata strategies improved F1 over the ViT-L/16 image-only baseline. Late fusion had the highest mean ROC-AUC and F1, the visual patch had the highest mean AUC-PR by a small margin and learned tokens had the highest mean sensitivity and balanced accuracy. For HR, ViT-L/16 late fusion had the highest mean values for several metrics, but its paired advantage over image-only was supported for F1, sensitivity and balanced accuracy rather than for ROC-AUC or AUC-PR. The visual patch and learned tokens were less consistent.
The results therefore indicate that the value of a metadata representation depends on the disease, model capacity and evaluation metric and that early fusion was not universally preferable. In this study, conventional late fusion by feature concatenation showed the most consistently favorable mean results across tasks, but without evidence of statistical superiority over the other multimodal strategies. The target-status ablations further show that part of the multimodal gain can arise from disease-related systemic context, particularly for the F1 of late fusion in HR. The models should therefore be understood as multimodal classifiers that combine retinal images with clinical context, rather than as tools for diagnosis based exclusively on retinal morphology. The visual patch remains attractive when preserving a purely visual interface is important and learned tokens offer a direct mechanism for cross-modal attention, but both require further validation.
Future work should extend the present target-status sensitivity analysis to variable-specific ablations of the remaining metadata, evaluate disease-restricted subgroups and compare the current approaches with Feature-wise Linear Modulation (FiLM), cross-attention and different sizes learned visual encodings. External validation, DR severity grading, additional retinal diseases, probability calibration and strategies specifically designed for rare HR cases are also required before clinical interpretation or deployment.

Supplementary Materials

The following supporting information can be downloaded at https://www.mdpi.com/article/10.3390/make8100299/s1: Table S1: Fold-specific performance and 95% patient-cluster bootstrap confidence intervals for diabetic retinopathy. Each cell reports the estimate followed by its 95% CI in brackets. Confidence intervals were obtained from 1000 patient-cluster bootstrap resamples; Table S2: Fold-specific performance and 95% patient-cluster bootstrap confidence intervals for hypertensive retinopathy. Each cell reports the estimate followed by its 95% CI in brackets. Confidence intervals were obtained from 1000 patient-cluster bootstrap resamples.

Author Contributions

Conceptualization, V.d.C.R.; Methodology, V.d.C.R.; Software, V.d.C.R., A.M. and W.G.M.; Investigation, V.d.C.R., A.M. and W.G.M.; Writing—original draft preparation, V.d.C.R. and W.G.M.; Writing—review and editing, V.d.C.R., A.M. and R.D.; Supervision, M.M.F.G., T.A.M. and R.D. All authors have read and agreed to the published version of the manuscript.

Funding

This study was supported by IATS-CARE: Institute for Health Assessment and Translation for Chronic and Neglected Diseases of High Relevance, funded by CNPq/Brazil (Grant No. 408659/2024-6). V.d.C.R. was supported by a Technological Development and Innovative Extension Fellowship from the Brazilian National Council for Scientific and Technological Development (CNPq; Grant No. 380610/2026-4).

Institutional Review Board Statement

This study used exclusively secondary, de-identified data from the Brazilian Multilabel Ophthalmological Dataset (BRSET) and involved no new participant recruitment or data collection [23,24]. The original BRSET data collection was approved by the Institutional Review Board of the Federal University of São Paulo (UNIFESP), Brazil (CAAE 33842220.7.0000.5505; ethics record No. 0698/2020). According to the original BRSET documentation, the requirement for individual informed consent was waived and all images were anonymized before release.

Data Availability Statement

The data used in this study are publicly available in the Brazilian Multilabel Ophthalmological Dataset (BRSET), hosted on PhysioNet at https://physionet.org/content/brazilian-ophthalmological/1.0.2/ (accessed on 20 September 2026). Further details about the dataset are provided in [23,24].

Acknowledgments

During the preparation and revision of this manuscript, the authors used ChatGPT (OpenAI) GPT-5.6 Sol and Claude (Anthropic) Sonnet 5 to assist with Portuguese-to-English translation, language editing, LaTeX/TikZ code for the schematic figures, code support and refactoring, and verification of bibliographic references. Consensus was used to support the identification of scientific literature. All references, code, numerical outputs and interpretations were checked and validated by the authors, who performed the model training and made all scientific decisions.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Teo, Z.L.; Tham, Y.C.; Yu, M.; Chee, M.L.; Rim, T.H.; Cheung, N.; Bikbov, M.M.; Wang, Y.X.; Tang, Y.; Lu, Y.; et al. Global Prevalence of Diabetic Retinopathy and Projection of Burden through 2045: Systematic Review and Meta-analysis. Ophthalmology 2021, 128, 1580–1591. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  2. 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.; et al. A foundation model for generalizable disease detection from retinal images. Nature 2023, 622, 156–163. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  3. Ali, G.; Dastgir, A.; Iqbal, M.W.; Anwar, M.; Faheem, M. A Hybrid Convolutional Neural Network Model for Automatic Diabetic Retinopathy Classification From Fundus Images. IEEE J. Transl. Eng. Health Med. 2023, 11, 341–350. [Google Scholar] [CrossRef] [Scilit]
  4. Engelmann, J.; Bernabeu, M.O. Training a high-performance retinal foundation model with half-the-data and 400 times less compute. Nat. Commun. 2025, 16, 6862. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  5. Zhou, Y.; Wang, Z.; Wu, Y.; Ong, A.Y.; Wagner, S.K.; Ruffell, E.; Chia, M.A.; Guan, Z.; Ju, L.; Engelmann, J.; et al. Understanding pre-training data effects in retinal foundation models using two large fundus cohorts. Nat. Commun. 2026, 17, 3309. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  6. Caron, M.; Touvron, H.; Misra, I.; Jégou, H.; Mairal, J.; Bojanowski, P.; Joulin, A. Emerging Properties in Self-Supervised Vision Transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision; IEEE: Piscataway, NJ, USA, 2021; pp. 9650–9660. [Google Scholar] [CrossRef] [Scilit]
  7. Oquab, M.; Darcet, T.; Moutakanni, T.; Vo, H.V.; Szafraniec, M.; Khalidov, V.; Fernandez, P.; Haziza, D.; Massa, F.; El-Nouby, A.; et al. DINOv2: Learning Robust Visual Features without Supervision. arXiv 2024, arXiv:2304.07193. [Google Scholar]
  8. Siméoni, O.; Vo, H.V.; Seitzer, M.; Baldassarre, F.; Oquab, M.; Jose, C.; Khalidov, V.; Szafraniec, M.; Yi, S.; Ramamonjisoa, M.; et al. DINOv3. arXiv 2025, arXiv:2508.10104. [Google Scholar] [CrossRef] [Scilit]
  9. Liu, C.; Chen, Y.; Shi, H.; Lu, J.; Jian, B.; Pan, J.; Cai, L.; Wang, J.; Zhang, Y.; Li, J.; et al. Does DINOv3 Set a New Medical Vision Standard? arXiv 2025, arXiv:2509.06467. [Google Scholar] [CrossRef] [Scilit]
  10. Tayebi Arasteh, S.; Shaigan, M.; Kuhl, C.; Kather, J.N.; Nebelung, S.; Truhn, D. Resolution Scaling Governs DINOv3 Transfer Performance in Chest Radiograph Classification. arXiv 2025, arXiv:2510.07191. [Google Scholar] [CrossRef] [Scilit]
  11. He, Z.; Fu, Y.; Jin, Y. Incentivizing DINOv3 Adaptation for Medical Vision Tasks via Feature Disentanglement. In Proceedings of the 9th International Conference on Medical Imaging with Deep Learning; PMLR (Proceedings of Machine Learning Research); Curran Associates, Inc.: Red Hook, NY, USA, 2026; Volume 315, pp. 2496–2513. [Google Scholar]
  12. Silva-Rodríguez, J.; Chakor, H.; Kobbi, R.; Dolz, J.; Ben Ayed, I. A Foundation Language-Image Model of the Retina (FLAIR): Encoding Expert Knowledge in Text Supervision. Med. Image Anal. 2025, 99, 103357. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  13. Shi, D.; Zhang, W.; Yang, J.; Huang, S.; Chen, X.; Xu, P.; Jin, K.; Lin, S.; Wei, J.; Yusufu, M.; et al. A Multimodal Visual–Language Foundation Model for Computational Ophthalmology. npj Digit. Med. 2025, 8, 381. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  14. Wang, M.; Lin, T.; Lin, A.; Yu, K.; Peng, Y.; Wang, L.; Chen, C.; Zou, K.; Liang, H.; Chen, M.; et al. Enhancing Diagnostic Accuracy in Rare and Common Fundus Diseases with a Knowledge-Rich Vision-Language Model. Nat. Commun. 2025, 16, 5528. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  15. Berger, L.; Lamard, M.; Zhang, P.; Borderie, L.; Le Guilcher, A.; Massin, P.; Cochener, B.; Quellec, G.; Matta, S. Context-Aware Vision Language Foundation Models for Ocular Disease Screening in Retinal Images. In Proceedings of the 2025 47th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC); IEEE: Piscataway, NJ, USA, 2025; pp. 1–4. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  16. Hsu, M.Y.; Chiou, J.Y.; Liu, J.T.; Lee, C.M.; Lee, Y.W.; Chou, C.C.; Lo, S.C.; Kornelius, E.; Yang, Y.S.; Chang, S.Y.; et al. Deep learning for automated diabetic retinopathy screening fused with heterogeneous data from ehrs can lead to earlier referral decisions. Transl. Vis. Sci. Technol. 2021, 10, 18. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  17. Zhou, H.Y.; Yu, Y.; Wang, C.; Zhang, S.; Gao, Y.; Pan, J.; Shao, J.; Lu, G.; Zhang, K.; Li, W. A Transformer-Based Representation-Learning Model with Unified Processing of Multimodal Input for Clinical Diagnostics. Nat. Biomed. Eng. 2023, 7, 743–755. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  18. Baltrušaitis, T.; Ahuja, C.; Morency, L.P. Multimodal Machine Learning: A Survey and Taxonomy. IEEE Trans. Pattern Anal. Mach. Intell. 2019, 41, 423–443. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  19. Zhao, F.; Zhang, C.; Geng, B. Deep Multimodal Data Fusion. ACM Comput. Surv. 2024, 56, 216. [Google Scholar] [CrossRef] [Scilit]
  20. Huang, S.C.; Pareek, A.; Seyyedi, S.; Banerjee, I.; Lungren, M.P. Fusion of medical imaging and electronic health records using deep learning: A systematic review and implementation guidelines. npj Digit. Med. 2020, 3, 136. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  21. Sharma, A.; Vans, E.; Shigemizu, D.; Boroevich, K.A.; Tsunoda, T. DeepInsight: A methodology to transform a non-image data to an image for convolution neural network architecture. Sci. Rep. 2019, 9, 11399. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  22. Zhu, Y.; Brettin, T.; Xia, F.; Partin, A.; Shukla, M.; Yoo, H.; Evrard, Y.A.; Doroshow, J.H.; Stevens, R.L. Converting tabular data into images for deep learning with convolutional neural networks. Sci. Rep. 2021, 11, 11325, Correction in Sci. Rep. 2021, 11, 14036. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  23. Nakayama, L.F.; Restrepo, D.; Matos, J.; Ribeiro, L.Z.; Malerbi, F.K.; Celi, L.A.; Regatieri, C.S. BRSET: A Brazilian Multilabel Ophthalmological Dataset of Retina Fundus Photos. PLoS Digit. Health 2024, 3, e0000454. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  24. Nakayama, L.F.; Goncalves, M.; Zago Ribeiro, L.; Santos, H.; Ferraz, D.; Malerbi, F.; Celi, L.A.; Regatieri, C. A Brazilian Multilabel Ophthalmological Dataset (BRSET); Version 1.0.2; PhysioNet: Cambridge, MA, USA, 2026. [Google Scholar] [CrossRef]
  25. Hu, E.J.; Shen, Y.; Wallis, P.; Allen-Zhu, Z.; Li, Y.; Wang, S.; Wang, L.; Chen, W. LoRA: Low-Rank Adaptation of Large Language Models. arXiv 2022, arXiv:2106.09685. [Google Scholar]
  26. Lin, T.Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal Loss for Dense Object Detection. IEEE Trans. Pattern Anal. Mach. Intell. 2020, 42, 318–327. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  27. Cui, Y.; Jia, M.; Lin, T.Y.; Song, Y.; Belongie, S. Class-Balanced Loss Based on Effective Number of Samples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE: Piscataway, NJ, USA, 2019; pp. 9268–9277. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.