NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Keep the Decoder Home: Selective Encryption for Federated Masked Pretraining

Hospitals hold large archives of unlabeled scans but only a few expert labels each. Self-supervised pretraining, where a model learns structure from raw images before seeing any labels, is the main reason a model can reach full-supervision accuracy with 1–10% of the labels. The best-performing pretraining in medical imaging is the masked autoencoder: the model hides most image patches and learns to redraw them. Pooling archives across institutions would make this pretraining much stronger, and federated learning is the usual way to do it. In federated learning, each site trains locally and sends only weight updates to a server. But updates are not private: attacks such as GradViT rebuild training images from vision-transformer gradients. Encrypting every update with homomorphic encryption fixes the leak, because it lets a server add up encrypted numbers without reading them. The cost is that server-side encrypted arithmetic routinely takes 80–95% of each training round.

This note proposes a specific way to pay much less for that protection. A masked autoencoder has two parts. The encoder turns the visible patches into features and is what gets reused for labeled tasks. The decoder turns those features back into pixels and is thrown away after pretraining. We conjecture that most pixel-level leakage sits in the decoder and in a small set of encoder attention weights. If so, sites can keep their decoders private and never share them, and encrypt only a small, label-free-selected slice of the encoder update. The rest of the encoder update travels in plaintext. The claim to test is that this gives the same downstream few-label accuracy and the same resistance to image reconstruction as fully encrypted federated pretraining, at a fraction of the cryptographic cost.

Core Claim

In federated masked-autoencoder pretraining across institutions, image-reconstruction risk is concentrated rather than spread evenly over the parameters. Two moves capture nearly all the privacy of full encryption while keeping the label efficiency that motivates pretraining. The first is keeping the pixel decoder site-local. The second is homomorphically summing only the top fraction of encoder parameters, ranked by a sensitivity score computed from the reconstruction loss rather than from labels.

The local decoder has a second expected benefit. Each site's decoder can absorb scanner- and site-specific appearance, so the shared encoder drifts less across sites whose data differ. We treat this as a hypothesis to measure, not an assumption.

Relation to Prior Work

Three lines of work motivate the proposal.

UltraFedFM pretrained a masked autoencoder across 16 institutions with encrypted updates. With 20% of the labels it beat supervised models trained from scratch, which shows that federated masked pretraining is worth doing. It does not report which encryption scheme it used, what the encryption cost, or whether the encoder or decoder leaks.

MRM shows how strong centralized masked pretraining is on radiographs. It reached 88.5% mean AUC on CheXpert with 1% of the labels. That is the accuracy a privacy-preserving federated version must approach.

GradViT inverts supervised vision transformers and finds that attention-layer gradients leak far more than the feed-forward layers. We use this finding as a prior on where encoder leakage sits. Whether it still holds when the loss is masked reconstruction rather than classification is exactly what we test.

Two papers supply the method.

SHE-LoRA encrypts as little as 0.03% of low-rank fine-tuning parameters, chosen with a pruning-style sensitivity score. It reorders columns so that encrypted values pack densely, and this defeats an exact gradient-inversion attack. Its selection was developed and validated for supervised fine-tuning of low-rank adapter layers. We carry the column-selection-and-packing idea over to dense encoder weights under a pretraining objective, where no labels exist and the update covers the whole backbone.

BatchCrypt quantizes and packs gradients into large integers before encryption. It reports 23–93x speedups with under 1% accuracy loss, and it is our encryption engine for both the selective and the full variants.

Two papers constrain the design.

HETAL shows that encrypted training stays practical only when restricted to a final linear layer. This tells us that encrypting the computation itself is out of reach, so we encrypt only the summation step. PrivatEyes shows the same split works for supervised gaze models: 412 s versus 357 s for 10 rounds. It relies on multiple servers that do not collude with one another, which a typical hospital consortium does not have. That pushes us toward single-server homomorphic encryption with a key split among the sites.

FedEMA handles uneven data across sites in federated self-supervised learning. It blends each site's local model with the global model, using a mixing weight scaled by how far the two have diverged. The research file calls this incompatible with encrypted aggregation. We think that is likely wrong. As we read the method, each site computes that divergence itself against the global model it receives, which composes with a secure sum. We therefore treat FedEMA as a baseline to combine with encryption, not a gap to fill.

Research Program

The work has three parts.

The first part is a leakage map. We run federated masked-autoencoder pretraining in plaintext with a ViT-B encoder and the standard lightweight decoder at 75% masking. At chosen rounds we attack the update each site would send. The attack adapts GradViT to the reconstruction loss and gives the attacker the model but not the site's random mask. We attack each parameter group separately: decoder; encoder attention query, key, value and output projections; feed-forward blocks; patch embedding. We report reconstruction quality (PSNR and a perceptual metric) and re-identification rate against held-out patient images. The output is a ranking of where leakage lives.

The second part compares two label-free selection rules. One is a pruning-style score, weight magnitude times activation norm, computed on the site's own unlabeled batches under the reconstruction loss. The other is an attack-guided ranking: the server runs the inversion attack on public images to rank encoder columns once, before training starts. A shared mask is agreed on at the start, and columns are then reordered following SHE-LoRA so encrypted entries pack densely. Within each round, only the selected columns are summed under encryption, with the key split among the sites. We sweep the encrypted fraction from 0.1% to 100% to trace privacy against cost.

The third part tests whether the decoder can stay home. We compare a shared decoder with per-site private decoders. The checks are downstream label efficiency, encoder drift across sites, and leakage. Drift is measured as the distance between each site's local encoder and the global one, logged by the sites for analysis only.

Baselines

The naive reference point is local-only pretraining: each site pretrains on its own archive and fine-tunes on its own few labels. It sets the floor that collaboration must beat.

The privacy-free ceiling is plaintext federated masked-autoencoder pretraining with FedEMA-style client-side mixing. If the selective scheme loses meaningful accuracy against this, privacy is costing utility.

The strongest privacy competitor is fully encrypted federated pretraining: every parameter, decoder included, is summed under BatchCrypt packing. This is the configuration UltraFedFM implies, though that paper does not report its primitive or overhead. We beat it only if we match it on two fronts while using a fraction of its encryption time and bytes sent. Downstream AUC must be within 0.5 points. Inversion PSNR and re-identification must not be statistically distinguishable.

The noise-based competitor is differential privacy: clipped Gaussian noise on updates, tuned to the same attack-PSNR target, with accuracy reported at that matched privacy level.

The centralized accuracy anchor is MRM: 88.5% mean CheXpert AUC with 1% labels, and 73.2 Dice on SIIM-ACR pneumothorax with 10% labels. MRM uses paired reports that our image-only setup lacks. We therefore also train an image-only centralized masked autoencoder on the pooled data. This is the fair upper bound, since no reported result for it was found on Lacuna.

Three ablations isolate the key ingredients. First, the same encrypted fraction chosen at random, which tests whether the selection score matters. Second, decoder shared but selectively encrypted, which tests whether keeping it home matters. Third, decoder local but the encoder in plaintext, which tests whether any encoder encryption is needed.

All methods use identical sites, rounds, local epochs, ViT-B backbone, and a fixed hyperparameter search budget per method. Fine-tuning protocols are the same throughout.

Why not just…?

Why not just encrypt everything with BatchCrypt? This is the real threat. In a three-site consortium with modern hardware, fully packed encryption of a ViT-B update may already be affordable. If our measured full-encryption overhead per round is a small fraction of local compute time, the selective component is not worth its added attack surface. The contribution would then shrink to the leakage map and the local-decoder result, and we will say so. The cost curve in the third experiment below decides this; we do not argue it in advance.

Why not just keep the decoder local and send the encoder in plaintext? It is the cheapest option and might suffice, because the encoder sees only 25% of the patches. But GradViT shows attention gradients alone reconstruct recognizable images in supervised transformers. The third ablation measures directly whether the encoder still leaks once the decoder is removed from what is shared.

Why not just add differential-privacy noise? SHE-LoRA reports that noise is amplified in factorized layers. More generally, noise at levels that stop inversion degrades convergence. Few-label downstream tasks magnify small representation losses, especially for rare findings, where pretraining helps most (12-lead ECG SSL). The matched-privacy comparison makes this quantitative rather than asserted.

Why not just use SHE-LoRA's selection as-is? Its pruning-style score needs no labels, so it may transfer directly. It is included as one of our two selection rules. If it matches the attack-guided ranking, we adopt it and the novelty lies in its application to dense pretraining with a local decoder.

Proposed Experiments

The main setting treats MIMIC-CXR, CheXpert and NIH ChestX-ray as three sites. They are real distinct institutions, so differences across sites come from scanners and patient populations rather than synthetic partitions. Pretraining uses images only. Downstream evaluation fine-tunes on 1% and 10% of CheXpert and NIH labels (mean AUC) and 10% of SIIM-ACR pneumothorax (Dice). A CIFAR-10 skewed-split sanity check reproduces the FedEMA setting, where FedEMA reports 83.34% linear accuracy against 79.44% for FedBYOL. This lets the encrypted variants be compared to a published federated self-supervised number.

Three checks are decisive.

First, does the leakage map show concentration? Concentration here means a small set of encoder groups, together under 5% of encoder parameters, accounts for most of the drop in attack PSNR once encrypted. If leakage is diffuse, selective encryption cannot work and we report that negative result.

Second, at the smallest encrypted fraction that brings attack PSNR and re-identification to the fully encrypted level, is downstream accuracy within 0.5 AUC points of the fully encrypted run?

Third, is the per-round encryption time and communication saving large enough to matter against full BatchCrypt? Both are measured on identical hardware.

We also attack the securely summed update itself, since with only three sites the sum may still leak. We report this as a limitation rather than hide it.