Weight Sharing Across Views Also Shares the Scanner

Many medical exams capture the same patient several times: a frontal and a lateral chest X-ray, two CT intensity windows, several ultrasound planes. A common design feeds all of these views through one encoder with a single set of weights. The argument for this is that the encoder cannot spend capacity on quirks that belong to only one view, so it keeps what the views have in common. We point out that this argument cuts both ways when a model leaves the hospital it was trained in. Every view in an exam was acquired on the same machine, under the same protocol, at the same site. The scanner's signature is therefore common to all views, and a training signal that rewards cross-view agreement should keep that signature, and may even strengthen it. If so, the multi-view designs that look strongest on single-center data are also built to carry the cue that fails under domain shift, the drop in accuracy when a model meets data from a new site.

We propose to test this directly, and then to fix it with patient clinical data. Basic metadata such as age, sex and diagnostic labels carries no pixel-level scanner signature. We use it to build training pairs from different patients at different sites who share a diagnosis and have similar clinical profiles. The shared encoder is trained so that the views of these cross-site, clinically matched patients agree. Within-exam pairs cannot separate pathology from the scanner. Cross-site, metadata-matched pairs share only the pathology and the clinical context. In this setup, metadata decides what counts as "the same" for the shared encoder, rather than being concatenated at the end.

Core Claim

There are two linked claims. The first is diagnostic and falsifiable. A shared-weight multi-view encoder trained with within-exam cross-view agreement encodes acquisition site more strongly than independent per-view encoders do. Site encoding here means how accurately a linear probe can recover the source hospital from the frozen embedding. This stronger site encoding should predict a larger out-of-site drop in AUROC.

The second claim is constructive. Suppose positives for a supervised contrastive objective are restricted to cross-site pairs matched on label and metadata. Then the shared encoder keeps its in-domain advantages and closes more of the out-of-site gap than adversarial site-invariance training does. It should also avoid the in-domain accuracy loss that adversarial training is known to cause.

Concretely, let sample $i$ have shared-encoder embedding $z_i$ pooled over its views, site $s_i$, label $y_i$ and metadata vector $m_i$. Its positive set is $P(i)=\{j: s_j\neq s_i,\ y_j=y_i,\ \|m_i-m_j\|<\tau\}$, where $\tau$ is a matching radius. The training loss adds to the diagnostic loss

$$\mathcal{L}_i=-\frac{1}{|P(i)|}\sum_{j\in P(i)}\log\frac{\exp(z_i^\top z_j/T)}{\sum_{k\neq i}\exp(z_i^\top z_k/T)},$$

where $T$ is a temperature and the denominator runs over the batch. The term pulls $z_i$ toward the embeddings of its positives relative to everything else in the batch. Metadata also enters the classifier head late, so the visual encoder stays symmetric across views. This addresses the file's open tension between symmetric weight sharing and asymmetric clinical conditioning.

Grounding in Prior Work

The premise rests on work that describes what weight sharing does. Contrastive Multi-Modal Clustering argues that shared-weight multi-view learning filters view-private noise and amplifies information common across views. BidNet and Learning Dual-Pixel Alignment for Defocus Deblurring use a shared encoder to put two views in one comparable feature space. We accept these findings. Our point is that scanner signature belongs to exactly the "common information" category these papers describe.

The medical multi-view results we build on were all single-center. Reliable Liver Fibrosis Assessment from Ultrasound shares convolutional weights across ultrasound views and keeps light view-specific normalization. On one hospital's cohort it raised pAUC from 0.710 to 0.783. Dual Windows Are Significant shares a ResNet-50 across lung and mediastinal CT windows and reaches 90.57% accuracy. Its authors note that sensitivity stalls at 73.33% and that vital signs are needed. CTT-Net adds a visual-acuity token to dual-view OCT. None of these three was evaluated off-site, so they motivate the question rather than answer it.

The method borrows from PECon. PECon showed that supervised contrastive alignment of CT and health-record features beats self-supervised contrastive objectives, reaching AUROC 0.943 on RadFusion. PECon aligns modalities within one site. We use its supervised contrastive objective to align views across sites and use metadata only to choose pairs.

Three papers constrain the design. Learning Invariant Feature Representation to Improve Generalization Across Chest X-Ray Datasets shows that adversarial site removal helps out-of-source AUROC but can hurt in-source performance. That trade-off is the one we aim to avoid. ProstNFound shows that clinical prompts (age, PSA) add over 7% AUROC under leave-one-center-out evaluation, which supports metadata as a site-robust signal. Avoiding Catastrophic Referral Failures shows confident false positives under shift. Its post-hoc fix needs labeled target-domain validation data, which we will not assume.

Research Program

The first stage is a controlled test of the premise. We take paired frontal and lateral chest radiograph studies from the multi-site chest X-ray cohorts used by the adversarial invariance paper, MIMIC-CXR and CheXpert. We pass both views through a ResNet-34 under three regimes:

  • independent per-view encoders;
  • one shared encoder with diagnostic loss only;
  • one shared encoder with an added within-exam cross-view contrastive loss.

For each regime we freeze the embeddings and report site-probe accuracy. A synthetic variant makes the test causal. We apply a site-specific intensity curve and texture identically to both views of every exam at one site, correlate that site with the label in training, and break the correlation at test time. If the within-exam contrastive shared encoder does not carry more site information than independent encoders, the premise fails. We would then report that negative result and drop the claim that weight sharing is a liability.

The second stage builds the metadata-matched cross-site pairing above. We use age, sex and diagnostic label, and add MIMIC-IV linked health-record fields where they exist, following the multimodal MIMIC derivatives used by MedPromptX. Demographics differ between sites, so a sample may have no match within radius $\tau$. In that case we fall back to label-only positives and record how often this happens. We sweep $\tau$ to trace a curve: at very large $\tau$ the method becomes label-only supervised contrastive training, and at small $\tau$ positives become scarce.

The third stage tests robustness to missing views. NIH ChestXray14 is used as a held-out site evaluated frontal-only. The shared encoder pools over whichever views are present, so we can check whether its advantage survives an absent lateral view.

Baselines

The naive reference point is a single-view frontal ResNet-34 trained with ordinary empirical risk minimization on pooled source sites. This is the baseline configuration in the adversarial invariance paper, which reports out-of-source AUC-ROC of 0.65 when CheXpert is held out.

The strongest existing method is that paper's adversarial domain discriminator with gradient reversal, which reports 0.70 out-of-source AUC-ROC with CheXpert held out (Learning Invariant Feature Representation). Its published numbers are for frontal-only pneumonia and consolidation, so they are not directly comparable to our two-view setting. We will reproduce it in two forms: the frontal-only original and a two-view shared-encoder version. Only our reproductions will be compared to our method.

The multimodal reference is independent per-view encoders with metadata concatenated late. This is the fusion design of Impact of metadata in multimodal classification of bone tumours, which improved accuracy from 62.8% to 69.7% on a single center.

The multi-view reference is the shared encoder with view-specific normalization from the liver fibrosis work, trained with diagnostic loss plus late metadata.

Two ablations isolate the key ingredient:

  • Within-exam ablation. Same loss, but positives are the other views of the same exam. This tests the premise that within-exam agreement keeps site information.
  • Label-only cross-site ablation. Supervised contrastive training with cross-site, same-label positives and no metadata matching. This is PECon's objective transplanted to cross-site view alignment, and it isolates what metadata matching adds.

Fairness rules apply to every method. All use the same backbone, image resolution, number of training steps, and a fixed hyperparameter search budget of the same number of trials. Model selection uses source-site validation data only, under leave-one-site-out rotation, with five seeds.

Our method beats a baseline if, in leave-one-site-out evaluation, it meets three conditions:

  • its mean out-of-site AUROC exceeds the reproduced adversarial baseline by more than the seed standard deviation;
  • its in-source AUROC is no worse than the ERM shared encoder;
  • it produces fewer confident false positives at matched coverage, with no target-domain calibration.

Why not just…?

Why not just remove site information adversarially, as the chest X-ray invariance work does? This is the main competitor, and it may win on out-of-site AUROC alone. The evidence against it as a full solution is its documented loss of in-source performance. A second problem is that the discriminator must be told which site each image came from. It is never told what clinical content to keep. Our pairing specifies the content to keep rather than the nuisance to remove. The decisive comparison is the joint in-source and out-of-source result under identical budgets. If adversarial training matches us on both, the contribution reduces to the diagnostic finding from stage one.

Why not just use label-only supervised contrastive learning across sites, without metadata? This is a serious threat, because cross-site same-label pairs already break the shared-scanner shortcut. Metadata matching should help in two ways. Without it, positives can differ systematically in age or severity across sites, so the encoder may learn to ignore real demographic variation in appearance. In addition, PECon's gain came from clinically meaningful pairing. The $\tau$ sweep settles this directly: the large-$\tau$ end of the sweep is the label-only method. If the curve is flat, we will report that metadata matching adds nothing and recommend the simpler method.

Why not just prompt a large vision-language model with both views and the clinical notes? Medical thinking with multiple images reports that the best tested model reaches 57.2% on multi-image cases, against about 77% for human experts. It traces over 70% of errors to reading and integrating the images rather than to reasoning. That is the exact stage our encoder targets. These models are also not trained or calibrated per site. We will not claim our encoder fixes that bottleneck. We include a zero-shot open model on our test splits only as a reference point.

Why not just recalibrate confidence after deployment? The post-hoc referral methods require out-of-domain validation data to fit their shift parameters. They also change thresholds, not features. We report shifted split referral both with access to target-site labels, as an upper bound, and without it. Our method must approach the label-using version on risk-coverage curves without seeing target labels.

Proposed Experiments

The decisive checks are three.

The first is the site-probe accuracy of each regime, on real data and on the synthetic artifact data, set against its out-of-site AUROC drop. The premise predicts a positive correlation, with the within-exam contrastive shared encoder showing the highest site-probe accuracy.

The second is leave-one-site-out AUROC, in-source AUROC, and risk-coverage curves across MIMIC-CXR and CheXpert, with NIH ChestXray14 held out as a frontal-only site. All methods are compared against our reproductions of the adversarial and label-only baselines.

The third is a secondary transfer to multi-site fundus grading on EyePACS, APTOS and Messidor, where paired left and right eyes are the two views, if pairing identifiers are available. On those datasets XAI-MeD reports a 6% cross-domain gain from clinical rules. That gives a non-adversarial, knowledge-based comparison point, which we will reproduce rather than quote across protocols.

A positive result would change how multi-view medical encoders are trained. A negative result on the premise would still be useful, because it would show that within-exam agreement is safe under shift. That would justify the single-center claims made for shared weights.