Covariate-Locked Vessel Counterfactuals for Retinal Stroke Prediction

A photograph of the back of the eye shows blood vessels that are developmental and physiological cousins of the brain's small vessels. Deep networks can read stroke risk from these photographs. The hard part is that stroke is rare in screening populations. Among the few eyes that belong to future stroke patients, most are also old, hypertensive, or diabetic. A classifier trained on this data can score well by learning "looks old and hypertensive" rather than whatever the vessels independently say about the brain. Existing fixes for rare classes do not address this. Duplicating the rare cases or up-weighting their loss adds no new variety. Generating new rare-class images with a diffusion model, a generator that learns to turn random noise into realistic samples by gradual denoising, reproduces the same confounded mixture it was trained on.

We propose a targeted kind of synthetic augmentation. Start from a common-class eye, meaning a person who did not go on to have a stroke. Keep that person's background retinal tissue, age, blood pressure, and imaging center fixed. Regenerate only the vessel tree, conditioned on the stroke label. This yields "stroke-like vessels in a young, normotensive eye from an under-represented center": the combination the classifier almost never sees in real data but needs to see in order to stop relying on confounders. The claim is not that the generator invents new medical knowledge; it cannot, because it learns from the same few positives. The claim is that it redistributes the existing stroke-associated vessel signal across covariate settings where it is missing. We expect this to raise stroke discrimination within age, blood-pressure, and center strata, and to raise worst-subgroup performance without the "leveling down" that current bias fixes cause.

Why this gap, and what is already known

The case for a retinal proxy of cerebral disease is well established. A deep learning system for detecting silent brain infarction and predicting stroke risk trains a large vision transformer to detect MRI-confirmed silent brain infarcts from fundus photos, reaching an AUC of 0.797 against 0.633 for clinical traits, and predicts incident stroke with AUC 0.901 (DeepRETStroke results). Predicting Stroke through Retinal Graphs and Multimodal Self-supervised Learning represents the vessel tree as a graph, with junctions as nodes and segments as edges carrying length and tortuosity, and aligns it with clinical tables on UK Biobank. It reaches a stroke AUROC of 71.92% and explicitly names extreme class imbalance as untested. These papers motivate the work. Neither synthesizes data, and neither asks how much of its signal survives once age and blood pressure are held fixed.

Two findings constrain the design. On Biases in a UK Biobank-based Retinal Image Classification Model reports a 15% AUC gap across age groups and a 10% gap across assessment centers for a hypertension classifier. It also finds that resampling, GroupDRO, and domain-independent training close these gaps mostly by lowering overall performance. Any method we propose must therefore be judged on worst-group performance and mean performance together. Kim et al. show that after vessels are digitally removed, the remaining retinal background still predicts age with $R^2 = 0.92$ in healthy eyes, and that this relation shifts in hypertensive and diabetic eyes. The consequence is that you cannot paste a vessel tree from one person onto another person's background without creating a physiological chimera. The background itself carries systemic information, so it must stay with its owner.

On the generative side, Generation of Structurally Realistic Retinal Fundus Images with Diffusion Models supplies the method. It uses a diffusion model to generate artery/vein masks with a loss that emphasizes thin vessels, then a conditional GAN (pix2pixHD) that paints realistic fundus texture around a given mask. Its synthetic images fooled ophthalmologists in more than half of cases. It generates only healthy anatomy and is never tested on rare classes or systemic endpoints.

Among long-tail methods, Diff-Mix is the closest in spirit. It partially noises a common-class image and denoises it under a rare-class prompt, so the common image supplies layout and background, and it improved worst-group accuracy on Waterbird by 6.5% through counterfactual backgrounds. We borrow its partial-noising idea and its noise-dependent soft labels, but constrain what may change. Diff-Mix swaps whole images between unrelated classes and reports artifacts when shapes disagree. Our edits touch only the vessel layer and never cross people or covariate values. DiffuLT contributes the observation that the most useful synthetic samples lie "approximately in distribution", near the class margin rather than perfectly typical or wildly off-manifold. That observation sets our noise-level range. Relational Subsets Knowledge Distillation shows that in retinal data, resampling a rare label also resamples whatever co-occurs with it. Our covariate lock is a direct answer to that failure: co-occurring conditions are held fixed by construction.

Core Claim

Holding each eye's background tissue and clinical covariates fixed while regenerating its vessel tree under the stroke label produces augmentations with three properties. They increase stroke AUROC within covariate strata. They improve worst-group AUROC across age tiers and centers without lowering mean AUROC. They outperform both loss re-weighting on a retinal foundation model and unconstrained label-conditioned diffusion.

The mechanism is decorrelation. In real data, the stroke label and the covariates move together. In the augmented data, the stroke-associated vessel pattern appears across the full covariate range. A classifier can then reduce its loss only by reading the vessels.

Research Program

The pipeline has four parts, all trained on UK Biobank fundus photographs with linked stroke outcomes, the same cohort used by Huang et al.

The first part is decomposition. Each photograph is split into an artery/vein mask, produced by a segmentation network trained on DRIVE, HRF and RITE, and a vessel-removed background, produced by inpainting as in Kim et al. A renderer in the style of pix2pixHD is trained to reconstruct the original photograph from its own mask and its own background. Because every training pair shares an owner, the renderer never learns to mix people.

The second part is a conditional mask generator. A diffusion model over masks is conditioned on the stroke label $y$ and a covariate vector $c$ containing age, sex, systolic blood pressure, diabetes status, smoking, and assessment center. It is trained with random condition dropout so that we can use classifier-free guidance, a sampling trick that amplifies the difference between the conditional and unconditional predictions. We guide on $y$ while conditioning on $c$ in both branches. The guidance direction therefore approximates the vessel change associated with stroke at fixed covariates, rather than stroke's marginal correlates.

The third part is counterfactual editing. For a non-stroke eye with covariates $c$, we noise its mask to an intermediate step, denoise it with $y=1$ and the same $c$, and re-render the result with that eye's own background. Following DiffuLT's margin argument, the noise level controls how far the edit moves. Each edit receives a soft stroke label that increases with noise level, as in Diff-Mix. Edits are oversampled in covariate cells where real positives are scarcest: younger ages, normotensive eyes, and the outlier centers identified by Alloula et al.

The fourth part is a validity filter. Every synthetic mask is converted to the graph form of Huang et al. It is rejected if it has disconnected arterial or venous trees, or if its branching angles, tortuosity, or artery-to-vein caliber ratio fall outside the ranges observed in real eyes of the same covariate cell. This addresses the known failure of generators to produce fragmented or unphysiological vessels.

The downstream classifier is RETFound (Zhou et al.) fine-tuned on real plus synthetic data. We also train the graph attention network of Huang et al. on graphs from the same edited masks. This tests whether the benefit depends on the pixel pathway or carries over to topology alone.

A secondary endpoint uses UK Biobank brain MRI to derive infarct labels, closer to the silent brain infarction target of DeepRETStroke. We treat it as exploratory because the labels are derived by us.

Baselines

The naive reference point is RETFound fine-tuned for stroke with ordinary cross-entropy and standard flips and crops. No stroke AUROC for RETFound on UK Biobank was found on Lacuna; the closest reported figure is its 3-year heart-failure AUROC of 0.794 from color fundus photographs (Zhou et al.). We will therefore establish this baseline ourselves.

The strongest reported number on this exact task is the multimodal contrastive graph model of Huang et al., with a stroke AUROC of 71.92%. Their raw-image variant reaches 71.54% and their supervised baseline 69.30% (Huang et al.). We will rerun it on our splits rather than copy the number, because our splits are stratified by center. Beating it means a higher AUROC on identical held-out folds, with a bootstrap confidence interval that excludes zero difference.

DeepRETStroke's 0.901 comes from a different, non-public cohort. We will cite it for context only and not treat it as comparable.

The practically strongest competitor is RETFound fine-tuned with loss re-weighting. We will test class-balanced and focal losses, plus logit adjustment, which shifts decision thresholds by class frequency. Each gets the same number of epochs and the same hyperparameter search budget as our method, including the extra images: re-weighting runs are allowed as many additional gradient steps as the synthetic data would add. We also include minority oversampling and GroupDRO over age-by-center groups, the methods Alloula et al. found to level down.

Next is feature-space augmentation in the style of RISDA, which reduced CIFAR-100-LT error to 55.24% at imbalance factor 200. It borrows covariance from related classes and applies it to RETFound embeddings of stroke cases. It is cheap and requires no pixel synthesis.

Three ablations isolate the key ingredient. The first is unconstrained diffusion: a DiffuLT-style label-conditioned generator of whole images, with no covariate lock and no background lock, given the same number of synthetic samples. This is the obvious idea at this intersection. The second is a vessel-only edit conditioned on $y$ but not on $c$. The third is a random-edit control that uses the same noise levels but denoises with $y=0$. It separates "the stroke direction helps" from "any vessel perturbation regularizes."

Beating the field means two things together. Our method must improve worst-group AUROC over the best re-weighting baseline while keeping mean AUROC no lower than that baseline. It must also beat all three ablations on within-stratum AUROC.

Why not just…?

Why not just fine-tune RETFound with a class-balanced or logit-adjusted loss? This is the real threat. Foundation models are label-efficient, and re-weighting may already recover most of the overall AUROC. The file gives no evidence that re-weighting fails on retinal stroke specifically. The evidence against it concerns subgroups: Alloula et al. found that reweighting-family methods close age and center gaps by lowering overall performance. Our claim is therefore not about mean AUROC. It is about within-stratum AUROC and worst-group AUROC at fixed mean. If re-weighting matches us on those, the counterfactual machinery is not worth its cost, and we will say so.

Why not just add the clinical covariates as inputs? A covariate-only model plus the image will score well. It still does not tell us whether the retina adds cerebral information beyond age and blood pressure, and at deployment the image model may shortcut through the same covariates. We report incremental AUROC of every image model over a covariate-only logistic model, fitted and evaluated per stratum. A method that only matches the covariate model has learned nothing about the brain.

Why not just generate stroke-labelled fundus images directly? Diffusion models are good at retinal realism, so this is the obvious approach. The problem is what they learn: a generator conditioned only on the stroke label reproduces stroke's correlates, so its samples look older and more hypertensive. Training on them would strengthen the shortcut. The unconstrained-diffusion ablation tests this directly. We predict it will raise mean AUROC slightly but will shift an independent age predictor's outputs on its samples and will not raise within-stratum AUROC.

Why not just augment in embedding space, as RISDA does? It costs almost nothing. However, borrowed covariance moves embeddings along directions that also encode age and center, and it offers nothing a clinician can inspect. If it matches us on within-stratum metrics, we will prefer it and report that result.

Proposed Experiments

All experiments use UK Biobank eyes with incident stroke outcomes. We run leave-one-assessment-center-out folds, so every result also measures transfer to an unseen center. Metrics are AUROC and AUPRC (precision-recall is more informative at this prevalence), calibration error, worst-group AUROC over age tiers and centers, and incremental AUROC over covariates.

Three checks decide whether the core claim holds.

The first is the confounder-leak check. On each set of counterfactual edits, we apply two frozen age predictors: one reads the background alone, following Kim et al., and one reads the vessel graph alone. We also apply a blood-pressure predictor. Their outputs should not shift meaningfully relative to the source eyes. A large shift means the "stroke direction" is really an aging direction, and the method has failed at its central premise.

The second is the within-stratum test. For eyes matched on age decile, blood-pressure tier, and center, stroke AUROC with our augmentation must exceed both re-weighted RETFound and the random-edit control.

The third is the leveling-down test. Across age and center groups, we plot mean AUROC against worst-group AUROC for every method. Ours should lie above the curve traced by GroupDRO and re-weighting, not along it.

Secondary analyses measure three further things. We sweep noise level to locate DiffuLT's "approximately in distribution" range for vessel edits. We compare RETFound against the graph network trained on the same edits, to see whether the gain comes from topology. Finally, we run a blinded ophthalmologist read of rendered counterfactuals, repeating the Turing-test protocol of the CVPR 2024 study but on edited rather than healthy anatomy.