Do Brain-Dynamics Biomarkers Survive a New Scanner? Encrypted Leave-One-Site-Out Validation

Dynamic functional connectivity (dFC) asks how the coordination between brain regions changes from minute to minute during a functional MRI scan. Instead of one correlation matrix for the whole scan, it produces a sequence of matrices from short overlapping time windows. Summaries of that sequence are reported to track intelligence, expertise and psychiatric illness. Examples include how long the brain stays in one connectivity pattern ("dwell time") and how much ground it covers ("fluidity"). Nearly all of this evidence comes from models that were developed and tested on data from the same sites.

There is a simple reason to doubt that these signals transfer. The variability of a short-window correlation depends heavily on how many time points fall in each window. That number changes with each scanner's sampling interval and with the protocol. A site with a slow sampling rate produces noisier windows, so its subjects look more "fluid" for purely technical reasons. We propose to test whether dFC biomarkers survive strict leave-one-site-out validation once this acquisition-driven noise is removed. The test should run the way a real consortium would have to run it: the held-out hospital never ships its scans, and the consortium never ships a model that could leak who was in its training cohort. The two ideas a colleague should take away are these. First, we harmonize dynamic connectivity at two levels, correcting between-subject site shifts and correcting within-subject noise inflation separately. Second, we arrange the geometry so that every step crossing institutional boundaries is a sum or an inner product, which is exactly what homomorphic encryption (computation directly on encrypted numbers) handles cheaply.

Core Claim

The claim has three parts. First, site differences in sampling rate and window length inflate the window-to-window dispersion of dFC in a predictable, site-specific way. Existing harmonization does not address this, because it operates on one static matrix per subject. Second, the problem splits cleanly in the log-Euclidean tangent space, the flat space reached by taking the matrix logarithm of each correlation matrix, which respects the fact that these matrices are symmetric positive-definite. In that space each window splits into a subject mean plus a within-subject deviation. The mean can be aligned across sites with first- and second-order statistics. The deviation can be rescaled by a noise floor that each site estimates on its own. Third, because all cross-site quantities are sums, the whole leave-one-site-out evaluation can run under the CKKS encryption scheme at low multiplicative depth. This includes harmonization statistics, federated training, and scoring the held-out site. Its accuracy should be indistinguishable from the plaintext version.

The scientific question is the first part. The cryptography makes the question answerable in the setting where it matters. If dFC features stop adding anything over static connectivity once properly harmonized and tested on unseen sites, that negative result is worth publishing as well.

Relation to Prior Work

Several papers motivate the gap. Reviews and empirical studies argue that dynamic metrics carry information that static connectivity misses. Du et al. survey the chronnectome literature. Su et al. and Woolrich et al. link network reconfiguration to intelligence, the latter using hidden Markov state models on 1003 HCP subjects. Premi et al. report greater meta-state total distance in chess professionals than in beginners. All of these are single-cohort analyses. None asks whether the metrics survive a change of scanner, and Du et al. themselves flag the instability of short windows as the core weakness of sliding-window estimates.

Our method borrows from two places. RLET maps static connectivity matrices to the log-Euclidean tangent space and translates each site's Fréchet mean onto the global mean. That paper reports 33 significant ADHD-related connectivity anomalies after harmonization versus 21 without it, on 160 ADHD-200 subjects. We reuse its tangent-space translation. We extend it in two directions it leaves open: it matches only means, not dispersion, and it handles only static matrices, not window sequences. It also assumes pooled data, which we remove. Secure Neuroimaging Analysis using Federated Learning with Homomorphic Encryption and MetisFL supply the encrypted aggregation recipe. They run CKKS weighted averaging of model weights, the first with depth 2, 52-bit scale, 8192 slots and 128-bit security, and MetisFL reports only 7% runtime overhead. Both work on structural MRI with no functional dynamics, and neither harmonizes. Securing Approximate Homomorphic Encryption Using Differential Privacy constrains our design. It shows that CKKS decryption errors can leak key bits to anyone who sees decrypted outputs, unless post-decryption noise is added. Any decrypted aggregate we release must therefore be noise-flooded.

The closest competitors in deployment are federated systems that each leave one piece out. FedGST builds sliding-window dFC graphs on clients and sends plaintext intermediate activations to a server graph network. It has no encryption and no geometric harmonization. DAFed uses adversarial feature disentanglement with differential-privacy noise, but on static connectivity only and without encryption. DSVB models dynamic graphs with adversarial site regularization, but trains centrally. SHRED-III learns site-invariant static features with a variational autoencoder. It also warns that aggressive harmonization can erase real pathology on small sites. We treat that warning as a hypothesis to test rather than ignore. Unlike all of these, we make held-out-site evaluation itself the object of study, and we isolate a dFC-specific confound none of them model.

Research Program

Each site parcellates its scans with a common atlas, for example 100 regions, giving 4,950 unique edges. It computes window correlation matrices, shrinks them slightly to guarantee positive-definiteness, and maps each window to the tangent space as $z_{i,t} = \mathrm{vec}(\log C_{i,t})$. All of this happens locally and in plaintext. Here $C_{i,t}$ is subject $i$'s correlation matrix at window $t$. Each tangent vector fits into one CKKS ciphertext of 8192 slots.

The site then splits each window into the subject mean $m_i$ and the deviation $d_{i,t} = z_{i,t} - m_i$. It also estimates its own noise floor $\rho_s$, which is the per-edge dispersion of $d_{i,t}$ computed on phase-randomized surrogate time series. These surrogates keep each region's spectrum and the static correlation but destroy genuine dynamics, so $\rho_s$ measures how much "dynamics" this site's acquisition manufactures by itself. The harmonized window is

$$\tilde z_{i,t} = \mu_g + \frac{\sigma_g}{\sigma_s}\odot(m_i - \mu_s) + \frac{\rho_g}{\rho_s}\odot d_{i,t},$$

where $\mu_s,\sigma_s$ are the per-edge mean and standard deviation of subject means at site $s$, $\mu_g,\sigma_g,\rho_g$ are consortium reference values, and $\odot$ is elementwise multiplication. The first correction term is RLET plus the second-order dispersion matching it lacks. The second term is the new dFC-specific correction.

Cross-site work reduces to three encrypted operations. The training sites' sums of $m_i$, $m_i\odot m_i$ and $\rho_s$ are aggregated under threshold CKKS at depth 1. Only the noise-flooded consortium reference $(\mu_g,\sigma_g,\rho_g)$ is decrypted. Each site then harmonizes locally. A held-out site needs only the released reference and its own statistics, so it can harmonize without ever contributing to training, which mirrors prospective deployment.

On harmonized windows we compute dynamic features. These are per-edge temporal dispersion, fluidity, and dwell times and transition rates under connectivity states found by federated k-means, whose centroid updates are again sums. We concatenate these with the static mean. A tangent-space logistic regression is trained by encrypted weighted averaging across training sites, as in MetisFL.

For external validation, the held-out site encrypts its feature vectors under its own key. The consortium computes encrypted inner products with its plaintext weights, which takes one plaintext multiplication plus rotations. The site decrypts the scores and computes the area under the ROC curve (AUC) itself. The consortium learns only the noised AUC, and the site never sees the weights.

We deliberately avoid putting a deep adversarial network under encryption. Gradient reversal and nonlinear discriminators blow the CKKS noise budget, and our position is that geometry, not network capacity, should carry the harmonization. The Why-not section explains how we test that position.

Baselines

The do-nothing reference is the same tangent-space dFC pipeline with no harmonization, trained on the pooled training sites and tested on the held-out site in plaintext. It measures the raw performance cliff that Cross Dataset Validation for Robust Model Generalization describes.

The strongest simple competitor is static connectivity with ComBat harmonization and a linear classifier. Its static-only, geometry-aware variant is static RLET. These ask whether dynamics and dispersion matching add anything at all. They get the same atlas, the same subject lists, the same classifier family, and hyperparameters tuned by nested cross-validation inside the training sites only, with an identical search budget.

The strongest published systems are DAFed, which reports 76.4% accuracy on ABIDE (370 subjects, 4 sites) against 66.9% for FedAvg, and FedGST, which reports 69.53% accuracy on 871 ABIDE subjects and 71.27% on 775 ADHD-200 subjects. DSVB reports 78.44% accuracy on 144 ABIDE subjects, but in a centralized setting that is not comparable to leave-site-out. These numbers come from different subject sets and split protocols. We will therefore re-run DAFed and FedGST from their descriptions under our leave-one-site-out splits, give them the same tuning budget, and report the published figures only as context. For leave-one-site-out AUC on ABIDE or ADHD-200 specifically, no reported result was found on Lacuna for these methods.

The pooled, plaintext, centrally harmonized version of our method is the ceiling. Encryption should cost nothing in accuracy relative to it.

Two ablations isolate the key ingredient. The first removes the within-subject rescaling $\rho_g/\rho_s$, keeping the mean and dispersion terms. The second removes the second-order term $\sigma_g/\sigma_s$, which reduces the method to dynamic RLET.

Beating the baselines means a higher mean leave-one-site-out AUC than static ComBat and the re-run DAFed, with the gain holding across held-out sites under a paired test over sites rather than only on average. It also requires that the within-subject ablation loses most of that gain.

Why not just…?

Why not just use static connectivity with ComBat? This is the most serious threat, and the proposal is built to settle it rather than argue past it. The arguments against it in the literature cut two ways. RLET shows that treating matrices as flat vectors yields fewer detectable anomalies (21 versus 33). Yet the claimed superiority of dynamics over static connectivity (Woolrich et al.) comes from single-cohort data. If static ComBat matches our method on held-out sites, we will report that dFC adds nothing portable for these disorders. The surrogate-null analysis below will show whether the "dynamic" signal was mostly acquisition noise.

Why not just share the trained model, perhaps trained with differential privacy? Shipping weights is simpler, but MetisFL reports 80% membership-inference success against unprotected updates. Driving that toward chance required differential privacy on top of encryption. Local noise strong enough to protect a small clinical cohort is also expensive in utility: Accurate, Private, Secure, Federated U-statistics shows error shrinking at $O(1/n^2)$ with secure aggregation versus $O(1/n)$ with local noise. We will include a model trained with differential privacy and shipped in plaintext as a comparison arm, at matched membership-inference risk, so the cost of this shortcut is measured rather than asserted.

Why not just use secure aggregation by masking instead of homomorphic encryption? For the harmonization statistics, masking would work. We say so plainly: that step needs only secure sums, and we use CKKS mainly to share one protocol with the evaluation step. Masking cannot score the held-out site's private features against the consortium's private weights. That two-party computation is where encryption is actually necessary, and its cost is what we measure.

Why not just train a deep adversarial dynamic-graph model such as DSVB or DAFed? These may fit better within a cohort. However, SHRED-III warns that learned harmonization can wash out pathology on small sites. Adversarial training also cannot run under CKKS at practical depth. Our re-run of DAFed under leave-site-out splits tests directly whether learned invariance beats geometric correction on unseen scanners.

Proposed Experiments

The first decisive check uses synthetic sites with known ground truth. From HCP data (sampling interval 0.72 s), we create pseudo-sites by temporally downsampling to 2 s and 2.5 s and by shortening scans, so the true dynamics are the same by construction. Before harmonization, dwell time and fluidity should differ systematically across pseudo-sites. After full harmonization, those differences should vanish. Mean-only harmonization should leave them in place. The data's two sessions per subject also let us check that within-subject test-retest reliability of dynamic features is preserved, which guards against the over-correction that SHRED-III warns about.

The second experiment is real leave-one-site-out validation on ABIDE, whose sites differ in sampling interval, and on ADHD-200, including the four sites RLET used. We report per-site AUC and balanced accuracy, plus site-identifiability, meaning how accurately a classifier can name the site from harmonized features, where lower is better. We also count significant diagnosis-related edges in the RLET style. All results are compared against the baselines above.

The third experiment measures the cost of encryption. We report the per-slot and AUC discrepancy between encrypted and plaintext runs, which should sit near CKKS precision and well below between-site variance. We also report runtime, ciphertext traffic per site, and the AUC shift caused by the post-decryption noise required for IND-CPAD security (Li et al.).

The proposal fails on its scientific claim if the within-subject rescaling ablation changes neither the synthetic-site agreement nor held-out AUC. It succeeds if harmonized dFC beats static ComBat on unseen sites and the encrypted protocol reproduces the plaintext numbers.