Enclave-Enforced Out-of-Sample Serving for Private Brain-Age Gaps

A brain-age model is trained on healthy people's MRI scans to predict their age. When it is applied to a new person, the gap between predicted and actual age, called the brain-age gap, is read as a sign of accelerated or slowed aging. That gap is the clinical product. It is also where the model leaks privacy. Deep brain-age regressors fit their own training subjects unusually well, so a small gap is itself evidence that a scan was in the training set. Membership Inference Attacks on Deep Regression Models for Neuroimaging showed that attackers can guess training-set membership with 78.05% accuracy on a 3D convolutional network and 83.04% on a 2D slice-mean network. The standard noise-based defense, differentially private training, pushed attacks to chance but roughly doubled the mean absolute error. Effects worth detecting are only a few years, such as the +3.55-year gap in schizophrenia reported by the ENIGMA Schizophrenia consortium, so an error that large makes the model clinically useless.

We propose to break this tradeoff without adding noise. The service will never answer a query about a person using a model that was trained on that person. Many submodels are trained on overlapping halves of the healthy reference cohort. When a query matches a training subject, the answer comes only from the submodels that never saw that subject. When it does not match, the answer comes from an equally sized subset chosen pseudo-randomly. Under this rule, the gap a training member receives has the same distribution as a stranger's, by construction.

This routing only protects anyone if the host cannot read three things: the list of who was in training, the individual submodels, and which branch the code took. A trusted execution environment (a hardware-isolated region of the processor whose memory the host operating system and administrators cannot read, and whose loaded code can be cryptographically proven to remote parties) supplies exactly those guarantees. The enclave is therefore what makes this design possible on infrastructure that no participating hospital controls. It is not simply a faster substitute for encryption.

Core Claim

For normative regression models, the released residual is itself the membership signal. Hiding model layers therefore cannot stop the strongest attack, and adding noise destroys the residual's clinical value. Our claim is that enclave-enforced out-of-sample serving can do three things at once. It can bring black-box membership inference to near chance. It can keep brain-age error close to that of a single model trained on all the data. It can also remove the systematic underestimation of gaps for training subjects, which today quietly biases any downstream study that reuses those subjects.

Concretely, assume $M$ submodels $f_1,\dots,f_M$, each trained on a balanced half of the reference cohort, so that every training subject is excluded from exactly $M/2$ of them. For a scan $x$ with chronological age $y$, the enclave returns

$$\hat{\Delta}(x) = g\Big(\tfrac{1}{|S(x)|}\textstyle\sum_{m\in S(x)} f_m(x)\Big) - y,$$

where $S(x)$ is the set of submodels that excluded the matched subject. If no subject matches, $S(x)$ is a size-$M/2$ subset drawn deterministically from a keyed hash of the scan, so that repeated queries of the same scan cannot be averaged. The function $g$ is the age-bias correction for regression toward the mean, the well-known tendency of these models to overestimate young subjects and underestimate old ones (Cheng et al.; Sihag et al.).

The design has a useful side effect. Every training subject automatically has an out-of-sample prediction, so $g$ can be fit on the entire cohort without a separate calibration split.

Research Program

We will build the service in four parts and test each separately.

The first part is the training side. Following the TSAN cascade with ranking loss of Cheng et al., currently the strongest image-based clock in the file, and the simpler 3D network of Gupta et al., we train $M\in\{4,8,16\}$ submodels on age-stratified balanced halves. Training can happen inside a confidential virtual machine, the setting Marshaled Learning found practical at a 1–3× overhead. Pooling scans from several institutions inside an attested enclave also addresses a weakness of plaintext decentralized training (Saha et al.) and of homomorphic federated averaging (Stripelis et al. 2021): neither protects local computation or certifies what code ran.

The second part is the sealed registry and the matching step. The registry stores a compact identity embedding for each training subject. CALTRAIN (Gu et al.) stored penultimate-layer embeddings as forensic fingerprints; we reuse that idea, but for a different job. Here the embedding must recognize the same person across noise, defacing, resampling and repeat visits, not just detect an exact duplicate. This step is the weak point of the whole design. If an attacker's rescan of a member fails to match, that member is answered by submodels that saw them, and the protection is lost for that query. We will therefore measure the match recall directly.

The third part is oblivious routing. Choosing $S(x)$ with an ordinary branch or memory lookup would expose membership to the host through access patterns, the very class of leak documented for enclaves (Side Channel Vulnerabilities in Trusted Execution Environments). Following the data-oblivious design principle of Allen et al., the enclave will run all $M$ submodels and combine them with a constant-time mask. This accepts roughly $M$-fold inference cost in exchange for removing the side channel. Because only inference runs at serving time, the memory needed is set by one 3D forward pass plus $M$ sets of weights. We will measure it on both legacy SGX, whose 128 MB secure memory region leaves about 93 MB for applications (DarkneTZ; PRESAGE), and a confidential virtual machine.

The fourth part is the release policy. The registry is fixed after training. Model refreshes will use the monotonic-counter rollback protection of ROTE so that the host cannot replay an old registry. Remote attestation lets each data-contributing hospital verify that the deployed code actually implements this policy before it releases data.

Baselines

The naive reference point is a single TSAN-style model trained on the full cohort and served in plaintext. This sets the utility ceiling. Cheng et al. report an MAE of 2.428 years and an AUC of 0.904 for separating healthy controls from Alzheimer's patients using the gap. It also sets the privacy floor: Gupta et al. report attack accuracies of 78.05% and 83.04% for comparable unprotected 3D and 2D regressors.

The strongest privacy competitor is differentially private training as run by Gupta et al. It reached chance-level attacks but doubled MAE. We will re-run it on our splits at matched privacy levels and the same tuning budget. We beat it if we reach comparable attack accuracy at an MAE within 0.3 years of the naive model; that threshold is our own target, not a reported figure.

The strongest system-level competitor is homomorphically encrypted federated training as in Stripelis et al. 2022. It reported reducing membership attack success from 80% to near 50% with minimal impact on error and a 7% runtime overhead. On its face this contradicts our premise. However, that protection concerns the weight updates exchanged during federation, and the finished model is still deployed and queried in the clear. We will train with their protocol and then run the black-box residual attack against the deployed model. We beat this baseline if the residual attack on their deployed model stays well above chance while ours does not. If their deployed model is already near chance, our premise is wrong for that setting and we will say so.

The layer-hiding competitor is DarkneTZ (Mo et al.), adapted to regression by placing the final layers inside the enclave. For classification it cut white-box attack precision from about 85% to about 50%.

Two ablations isolate the key ingredients. The first runs the same submodel ensemble without registry routing, so that every query is answered by a random half of the submodels. It shows whether excluding the matched subject's models, rather than simply ensembling, does the work. The second runs routing with branching code instead of oblivious masking. It shows whether access-pattern leakage is measurable in practice. All methods share the same UK Biobank split, architecture family, hyperparameter search budget and GPU-hours. The only exception is that the ensemble's total training compute is reported separately.

Why not just…?

Why not just hide the last layers in an enclave, as DarkneTZ does? That defense removes white-box access, but the gap still has to be released to clinicians. Gupta et al.'s black-box attack needs only that released output. We expect layer hiding to leave black-box attack accuracy essentially unchanged, and the DarkneTZ baseline is included to show this directly.

Why not just add differential privacy? Gupta et al. already measured the cost: error doubled, which is larger than the disease effects the clock exists to detect. Our approach is not differentially private in the formal sense. It is a structural guarantee that holds when the registry match succeeds. We will be explicit that the two guarantees differ in kind, and we will report accuracy of the strongest attacks we can build rather than a formal privacy bound.

Why not just do out-of-fold serving on an ordinary trusted server? This is the real threat. If the hospital running the service is fully trusted, the enclave adds only attestation. The proposal's value applies to settings where the host is not trusted, such as a public cloud or a consortium where no single institution should hold the others' membership lists. In those settings the registry, the submodels and the routing branch each leak membership on their own. Our experiments quantify each leak. White-box attacks on submodels exposed by a plaintext deployment test the submodel leak, and the branching-routing ablation tests the side-channel leak. If those leaks turn out negligible, the honest conclusion is that cross-fitted serving, not enclaves, is the contribution.

Why not just round or bin the released gap? Coarse release blunts the residual signal, but it also blurs the few-year differences that matter clinically. We will run binning at 1-, 2- and 5-year widths and report both attack accuracy and the Alzheimer's AUC at each width.

Proposed Experiments

The primary benchmark is UK Biobank T1 MRI using the 8,356/2,090 split of Stripelis et al. Clinical utility will be tested on ADNI and OASIS for healthy-versus-Alzheimer's and healthy-versus-MCI AUC, following Cheng et al. If access allows, a second modality will test whether the effect generalizes beyond imaging: 12-lead ECG age on the CODE cohort, where Lima et al. reported an MAE of about 8.4 years and a mortality hazard ratio of 1.79 for gaps above 8 years.

The attack suite has three parts. The first is Gupta et al.'s residual-threshold attack and a learned black-box attack that uses residual plus age. The second is white-box gradient attacks on any baseline that exposes weights. The third is an adaptive attack that submits perturbed, defaced or follow-up scans of known members in order to evade matching. We report attack AUC and accuracy against each method, MAE, healthy-versus-Alzheimer's and healthy-versus-MCI AUC, the gap difference between members and non-members, and enclave latency and memory.

The decisive checks are three. Black-box attack AUC under our method should fall to near 0.5, while the naive and Stripelis-style deployed models stay well above it. MAE should stay within our 0.3-year target of the full-data model while differential privacy does not. The adaptive evasion attack should succeed only at a rate bounded by the registry's measured miss rate on rescans. If rescan matching recall proves poor, the method's guarantee collapses for exactly the attacker who matters most. That result would redirect the work toward better identity matching before any deployment claim.