Pretrained representations are increasingly used to share and reuse information from medical images without exposing the original scans, but it is unclear how much patient-specific information these representations retain. We investigate this question for brain magnetic resonance imaging (MRI) by evaluating five frozen pretrained encoders spanning different architectures, pretraining objectives, and training domains on two longitudinal T1-weighted datasets, OASIS-2 and MIRIAD. Under an attacker model with access to released embeddings, the corresponding public encoder, and auxiliary MRI scans, we evaluate patient linkage and sensitive-attribute inference. Across the evaluated representations, we observe substantial subject-specific information: rank-1 patient linkage reaches up to 99% on MIRIAD and exceeds 90% on OASIS-2 for the highest-risk representation, despite the absence of an identification objective during encoder training. We further show that the released embeddings retain information about a demographic attribute, with recorded-sex prediction reaching balanced accuracy of 90.9% on OASIS-2 and 95.5% on MIRIAD. Overall, our results demonstrate that replacing raw brain MRI with learned embeddings does not, by itself, eliminate patient-linkage or attribute-inference risk, and is therefore insufficient on its own to establish anonymity.
Figures & tables
Model
Pretraining objective
Input
Backbone
Pretraining domain
Dim.
AnatCL ( Barbano et al., 2026 )
Weakly sup. contrastive
3D
ResNet18
Brain MRI
512
3D-Neuro-SimCLR ( Kaczmarek et al., 2025 )
Contrastive (SimCLR)
3D
ResNet18
Brain MRI
512
Brain-MRI-SSL ( Huang et al., 2025 )
Contrastive (MoCov3)
2D
ResNet50
Brain MRI
2048
DINO-ViT ( Caron et al., 2021 )
Self-distillation
2D
ViT-B/8
Natural images
768
SAM-Med3D ( Wang et al., 2024 )
Sup. segmentation
3D
ViT
Multi-organ medical
384
Table 1: Overview of the pretrained encoders evaluated in this work.
Characteristics
OASIS-2
MIRIAD
Subjects
150
69
Sex
58.7% F, 41.3% M
55.1% F, 44.9% M
Classes
72 NC, 64 AD, 14 Converted
46 AD, 23 CN
Preprocessing
Yes
No
Scans per subject
at least 2 scans variable follow-ups (1–6+ years)
4–12 scans (up to 9 visits) intervals of 2 weeks–2 years
Table 2: Characteristics of the OASIS-2 and MIRIAD datasets used in this study.
Figure 1: Threat models for released brain MRI representations. (a) The data holder and attacker apply the same frozen feature extractor f to private and auxiliary scans, respectively; either collection may contain multiple acquisitions per subject. The hospital’s original scans remain unavailable to the attacker. (b) A linkage function assesses same-subject correspondence; re-identification additionally requires identity-linked reference information. (c) A predictor fitted to attribute-labeled auxiliary embeddings estimates a withheld attribute from a released embedding, without requiring successful linkage.
OASIS-2
MIRIAD
Model
Linkability
ReID@1
Linkability
ReID@1
AnatCL
0.9312
0.9205
0.9714
0.9971
3D-Neuro-SimCLR
0.6571
0.6647
0.7938
0.9787
Brain-MRI-SSL
0.5647
0.5764
0.8460
0.9816
DINO-ViT
0.7796
0.8235
0.8761
0.9870
SAM-Med3D
0.2627
0.1394
0.5139
0.8958
Table 3: Re-identification risk evaluation of the pretrained encoders on OASIS-2 and MIRIAD
OASIS-2
MIRIAD
Model
Bal. Acc.
Precision
Bal. Acc.
Precision
AnatCL
0.6772
0.6965
0.6946
0.6983
3D-Neuro-SimCLR
0.7011
0.7075
0.7789
0.7806
Brain-MRI-SSL
0.9093
0.9153
0.9546
0.9568
DINO-ViT
0.7894
0.8100
0.8716
0.8704
SAM-Med3D
0.8632
0.8735
0.8850
0.8887
Table 4: Sex classification performance on OASIS-2 and MIRIAD.
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
OASIS-2
MIRIAD
Linkability
ReID@1
Linkability
ReID@1
Model
Canberra
Cosine
Canberra
Cosine
Canberra
Cosine
Canberra
Cosine
AnatCL
0.9312
0.5707
0.9205
0.8716
0.9714
0.6017
0.9971
0.9971
3D-Neuro-SimCLR
0.6571
0.3502
0.6647
0.4794
0.7938
0.3888
0.9787
0.9176
Brain-MRI-SSL
0.5647
0.4204
0.5764
0.6461
0.8460
0.6674
0.9816
0.9788
DINO-ViT
0.7796
0.5694
0.8235
0.8412
0.8761
0.8677
0.9870
0.9899
Appendix
Table 5: Linkability and rank-1 matching under Canberra-based and cosine similarity. Bold marks the higher (i.e., stronger attack) value for each pair.
Within-dataset
Cross-dataset
OASIS-2
MIRIAD
OASIS-2 → MIRIAD
MIRIAD → OASIS-2
Model
Bal. Acc.
Prec.
Bal. Acc.
Prec.
Bal. Acc.
Prec.
Bal. Acc.
Prec.
AnatCL
0.6772
0.6965
0.6946
0.6983
0.4784
0.4769
0.5130
0.5132
3D-Neuro-SimCLR
0.7011
0.7075
0.7789
0.7806
0.5000
0.2763
0.6170
0.6198
Brain-MRI-SSL
0.9093
0.9153
0.9546
0.9568
0.5032
0.7783
0.6351
0.7759
DINO-ViT
0.7894
0.8100
0.8716
0.8704
0.5151
0.6039
0.5464
0.7682
Appendix
Table 6: Sex inference from frozen embeddings. Within-dataset results use a patient-disjoint split; cross-dataset results train on one cohort and test on the other. Best value per column in bold.
MIRIAD (full)
MIRIAD (capped 2–5)
Model
Linkability
ReID@1
Linkability
ReID@1
AnatCL
0.9714
0.9971
0.9653 ± 0.0143
0.9883 ± 0.0064
3D-Neuro-SimCLR
0.7938
0.9787
0.7829 ± 0.0214
0.9160 ± 0.0138
Brain-MRI-SSL
0.8460
0.9816
0.8420 ± 0.0166
0.9343 ± 0.0157
DINO-ViT
0.8761
0.9870
0.8778 ± 0.0182
0.9675 ± 0.0085
SAM-Med3D
0.5139
0.8958
0.5204 ± 0.0185
0.6246 ± 0.0298
Appendix
Table 7: Re-identification risk on MIRIAD: full dataset vs. capped (2–5 scans per subject). Capped results are reported as mean ± std over 10 random subsamplings.
Figure 2: Representative mated and non-mated score distributions (KDE) for AnatCL and DINO-ViT on OASIS-2 (top) and MIRIAD (bottom), with the linkability D↔sys .
Brain foundation models are often tested with a probe. The model is frozen, a simple classifier is trained on its output, and the classifier's accuracy is taken as a sign of what pretraining learned. We show that this reading can be wrong unless two controls are reported with it. We probed three frozen 3-D brain-MRI models at five depths, on two independent multi-site cohorts (ABIDE-I and ABIDE-II). The site where a scan was acquired could be predicted at about 0.9, on a scale where 0 is chance and 1 is perfect. No clinical or demographic target came close. An untrained copy of the same model predicted site just as well on both cohorts. Untrained models of three architectures, each built with three random seeds, did the same on ABIDE-I. The raw image, shrunk to 12x12x12 voxels and given to no model at all, predicted site at 0.95. Pretraining did not create the site signal. It was already in the scans. We also looked for any clinical target on which pretraining beats an untrained model, and found no reliable case. Adjusting for age, sex and diagnosis left site prediction almost unchanged, and so did a 4.6-fold increase in the number of voxels. Resting-state fMRI from the same people showed the same pattern. Site was the most predictable attribute of brain connectivity (0.81), and it survived five untrained layers while age did not. We recommend reporting two controls with every probe of a brain foundation model: running the probe again on the untrained model, and on the raw input. We release the code for both.
Demographic attributes can be predicted from medical images, raising concerns about bias in clinical AI systems. In X-ray imaging, acquisition characteristics have been shown to contribute substantially to this predictability. Whether the same holds in brain MRI remains unclear, as anatomical variation and acquisition-dependent contrast are deeply entangled in the image formation process, obscuring the origins of demographic signal. To address this, we propose a controlled framework based on disentangled representation learning, decomposing brain MRI into anatomy-focused representations that suppress acquisition influence and contrast embeddings that capture acquisition-dependent characteristics. Training predictive models for age, sex, and race on full images, anatomical representations, and contrast embeddings allows us to quantify the relative contributions of structure and acquisition to the demographic signal. Across three datasets and multiple MRI sequences, demographic predictability is found to be driven primarily by anatomical variation, with anatomy-focused representations largely preserving the performance of models trained on raw images. Contrast embeddings retain a weaker signal that is dataset-specific and does not generalize across sites. These findings suggest that effective mitigation must explicitly account for the primarily anatomical and secondarily acquisition-dependent origins of demographic signal, ensuring that any bias reduction generalizes robustly across domains.
Mehmet Yigit Avci, Akshit Achara, Andrew King +1
and for the Alzheimer's Disease Neuroimaging Initiative · King’s College London, UK
Frozen features of brain MRI foundation models lose accuracy on new datasets, a failure usually blamed on the features encoding where each scan came from. We show that the failure lies elsewhere. Across 17 public datasets and eight frozen representations, every representation recognizes the MRI sequence within each dataset, yet most fail on an unseen one. The cause is neither dataset encoding nor a shift of each dataset: the content itself is encoded along different directions in each dataset. This explains which datasets fail, for the sequence and for sex, and why removing the dataset signal with INLP, LEACE, CORAL or adversarial training never improves sequence transfer. Only the broadly pretrained 3DINO and SAM-Med3D encode the sequence consistently enough to transfer; the brain-specific BrainIAC and BrainFM do no better than an untrained network. Code is available at https://github.com/BrainFM/brainfm-profiler/tree/main/representation_utility.
Minh Sao Khue Luu, Bair N. Tuchinov
The Artificial Intelligence Research Center of Novosibirsk State University, Novosibirsk 630090, Russia