Manuscript Offprint

arXiv:2610.13027

Dataset-Specific Encoding of Image Content Underlies Cross-Dataset Failure in Brain MRI Foundation Models

Minh Sao Khue Luu, Bair N. Tuchinov

Abstract

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.

1 Introduction

Public brain MRI datasets support machine learning research on neurological disease but are individually small and narrow. Foundation models for brain MRI are therefore pretrained on pooled collections drawn largely from public datasets [1–3]. Pooling increases sample size but introduces heterogeneity. Dataset bias is well known from natural images [4], and brain MRI adds to it: each public dataset mostly covers one disease, cohort and age range, so dataset identity is confounded with clinical content; sequences differ in contrast; release-specific preprocessing cannot be undone; labels overlap little across datasets; and subjects may recur across releases [5]. Models trained on such pools may learn dataset shortcuts [6, 7] rather than anatomy or pathology.

It is well established that representations retain where a scan came from. The source study or site can be decoded from brain MRI [8, 9], and recent negative controls show that this signal is already present in randomly initialized encoders and in the raw image [10], with the same pattern in EEG and fMRI foundation models [11, 12]. Frozen medical foundation models also lose accuracy on datasets and centres not seen in training, as shown for mammography [13, 14] and pathology [15, 16]. That frozen features fail across datasets is therefore known; why they fail is not. A representation can encode dataset identity and still transfer content, provided the content is encoded in the same way across datasets, so dataset identity alone does not explain the failure. For brain MRI, existing tests also do not cover the setting in which public data are actually pooled. They move between sites of a single study [10] or between scanners imaging the same subjects [17], or they apply simulated artifacts [18]. In the only brain MRI test of pretrained models against an untrained control, pretraining gave no reliable advantage [10], but only models of one architecture family were tested. Removing the site signal after extraction did not help on held-out sites [10], but whether this holds for other removal methods and for independent datasets, and what prevents it from working when the content is clearly encoded, has not been measured.

We address these questions with frozen representations, the way foundation models are commonly used. Transfer is measured by leave-one-dataset-out linear probing on 17 independent public datasets: a linear classifier trained on the frozen features of all datasets but one is evaluated on the held-out dataset. The probe predicts the MRI sequence (T1, T1c, T2 or FLAIR), the only content label available for every scan in all 17 datasets; disease labels barely overlap between datasets and are confounded with dataset identity. Sex, available in ten datasets, serves as a second, anatomical label. Because the sequence is easily recognized within every dataset, a failure to transfer it cannot be blamed on missing information, which lets us study why transfer fails rather than only whether it does. In short, we find that in most representations the difference between sequences is itself different in each dataset: this is not a shift, so centring does not repair it, and it ties the dataset signal to the content, so removing one removes the other. Our contributions are:

  • A diagnosis of cross-dataset failure that also explains why removing the dataset signal does not help. We separate three candidate causes of the failure: encoding of the source dataset, a shift of each dataset, and disagreement of the class directions between datasets. To tell them apart, we combine centring tests with a direction-consistency score adapted from cross-lingual transfer [19, 20]. With these tools we identify the cause for the sequence and for sex, rank representations from the training datasets alone, and explain why four removal methods (INLP, LEACE, CORAL and adversarial training) fail to improve transfer, revising the earlier explanation of this failure on held-out sites [10].

  • A controlled comparison of brain-specific and broadly pretrained foundation models. We compare two brain-specific and two broadly pretrained foundation models against four baseline encoders, with controls for architecture, input scaling, skull stripping and pretraining overlap. We show that broad multi-organ pretraining, not brain-specific pretraining, yields features that transfer across datasets, qualifying the earlier finding that pretraining adds nothing [10].

We release the code, the list of sampled scans and the result tables.

References (64)