MedShift: Synthetic-Real X-ray Adaptation
- MedShift is a domain adaptation framework for X-ray imaging that unifies synthetic and clinical domains using conditional transport in a shared latent space.
- It employs a conditional U-Net trained via Flow Matching and Schrödinger Bridge principles to enable unpaired, multi-domain translation across varying dose levels.
- Evaluations on the X-DigiSkull benchmark show that MedShift effectively balances image realism and anatomical fidelity while controlling realism–structure trade-offs.
MedShift is a synthetic-to-real X-ray domain adaptation framework for skull and head radiography that formulates cross-domain translation as implicit conditional transport in a shared latent space. It is introduced as a unified class-conditional generative model based on Flow Matching and Schrödinger Bridges, designed to bridge discrepancies between simulated and clinical X-ray images in attenuation behavior, noise characteristics, and soft tissue representation without paired supervision and without training separate models for each domain pair. The framework operates on multiple domains and dose regimes seen during training, supports unpaired translation between any such pair, and is evaluated together with the X-DigiSkull benchmark of aligned synthetic and real skull X-rays under varying radiation doses (Caetano et al., 29 Aug 2025).
1. Problem setting and domain gap
MedShift addresses the synthetic-to-real domain adaptation problem for skull and head X-rays. The motivating premise is that simulated radiographs are scalable, but often fail to capture clinically relevant image formation effects. The reported domain gap has three principal components: attenuation behavior, noise characteristics, and soft tissue representation. Simulators may oversimplify cortical and trabecular bone, air cavities, and overlapping anatomy, and may miss beam hardening and spectral effects. Real systems exhibit quantum noise, structured scatter, electronics or read noise, and dose-dependent post-processing texture that differ from synthetic views. Real images also show dose- and energy-dependent soft-tissue contrast with smooth bone–soft tissue interfaces, whereas simulators tend to produce sharper boundaries and miss subtle gradients (Caetano et al., 29 Aug 2025).
The method is explicitly conditional on domain identity and acquisition attributes. In the reported formulation, conditioning variables encode whether an image is synthetic or real and also encode dose level. The domains used for conditioning include synthetic Low and High, and real Low, Normal, and Exposure. This conditioning scheme makes MedShift a multi-domain translator rather than a single synthetic-to-real mapper.
A defining claim of the framework is that translation is unpaired and multi-domain. Unlike approaches that require paired supervision or domain-specific training, MedShift learns a shared, domain-agnostic latent manifold and performs translation between any pair of domains observed during training. This suggests that the method is intended to function as a reusable transport model across acquisition regimes rather than as a collection of pairwise translators.
2. Physical basis of the translation task
The paper motivates MedShift through X-ray physics. Under a polychromatic beam, transmitted intensity along a ray at energy is governed by the Beer–Lambert law,
where is the linear attenuation coefficient, varying with material composition and energy (Caetano et al., 29 Aug 2025).
Dose and spectrum modulate both signal statistics and contrast. For a detector with effective gain and incident photons , the quantum-noise-limited variance satisfies
while shot noise scales as
yielding dose-dependent signal-to-noise ratio
Higher dose and harder spectra increase contrast for dense structures such as bone and alter soft-tissue visibility. In the MedShift formulation, these relationships explain why a synthetic radiograph may be anatomically plausible yet still fail to match the clinical distribution in texture, contrast, and gradient structure (Caetano et al., 29 Aug 2025).
This physics-based framing is important because MedShift is not presented as arbitrary image stylization. The target is transport from a source distribution to a target distribution while preserving anatomy. The reported qualitative effects—smoother skull edges and gradients, more natural noise and contrast, and recovered soft-tissue shading—are therefore interpreted as corrections to known synthetic-real discrepancies rather than merely as perceptual changes.
3. Continuous-time transport formulation
MedShift models translation as continuous-time conditional transport from a source domain to a target domain 0. The goal is to map samples from 1 to 2 using conditioning variables 3 and 4 that encode source and target domain attributes. The transport is parameterized by a time-dependent velocity field 5 and can be interpreted through either a probability flow ODE or a Schrödinger Bridge construction (Caetano et al., 29 Aug 2025).
In the Flow Matching formulation, the dynamics are
6
and training supervises the learned velocity against a target bridge velocity. The reported objective is
7
Under an appropriate 8, this yields deterministic sampling without explicit noise simulation (Caetano et al., 29 Aug 2025).
The Schrödinger Bridge interpretation provides the stochastic counterpart. The bridge SDE is given as
9
with entropic regularization 0. In the reported system, this bridge view motivates the construction, but the experiments do not optimize an explicit Schrödinger Bridge loss. Training is FM-only, and practical sampling uses a deterministic ODE solver in latent space (Caetano et al., 29 Aug 2025).
This distinction matters. MedShift is conceptually linked to entropic optimal transport, but operationally it is an FM-trained latent transport model. The paper explicitly contrasts this with score-based diffusion, which relies on reverse SDE sampling and many stochastic steps, whereas MedShift directly learns a velocity field and integrates a deterministic ODE.
4. Latent-space architecture, conditioning, and controllable inference
MedShift operates in a VAE latent space. A pretrained VAE encodes images into latents, and a conditional velocity network acts on those latents. The velocity field is parameterized by a compact conditional U-Net with residual blocks and multi-resolution attention. The reported architecture uses input size 512, model channels 256, two residual blocks per level, channel multipliers 1, attention resolutions at 2 and 4, four attention heads, head channels 64, label dropout 0.2 for classifier-free guidance, and EMA rate 0.999 (Caetano et al., 29 Aug 2025).
Conditioning is discrete and unified. Domain labels encode synthetic versus real and the corresponding dose levels. Learned embeddings are injected into the U-Net through time or condition embeddings and feature modulation. Classifier-free guidance is used at both training and inference, with label dropout 2 during training to enable CFG at test time. This design allows a single model to handle translations such as synthetic-high 3 real-normal without retraining (Caetano et al., 29 Aug 2025).
Translation proceeds in two stages in latent space. Given an observed image 4 in source domain 5, the system first integrates backward from 6 to an intermediate time 7 under the source condition:
8
It then integrates forward from 9 to 1 under the target condition 0:
1
The intermediate time 2 is a central inference-time control. Larger 3 preserves anatomy more strongly; smaller 4 pushes the result further toward target appearance. CFG scale is the second control: higher CFG strengthens target-domain realism but can deviate more structurally. The reported implementation uses an Euler ODE solver with 50 integration steps, with typical CFG 5 and practical ranges 6 and CFG 7 (Caetano et al., 29 Aug 2025).
A key property of the framework is that these realism–structure trade-offs are controlled at inference rather than through retraining. The paper also notes a possible convex combination of perceptual and structural drift fields as an extension, but the reported setup relies on FM-only training and uses 8 and CFG as the actual post-training control variables.
5. X-DigiSkull benchmark and empirical results
The evaluation is built around X-DigiSkull, a dataset of aligned synthetic and real skull or head X-rays spanning viewpoints and dose levels. The synthetic partition is generated with the Mentice VIST® simulator, includes Low and High dose categories, covers viewing angles 9 at 0 increments, and contains 5,832 images. The real partition is acquired on a skull phantom using a Philips Azurion IGT system from common neuro procedure working positions, includes Low, Normal, and Exposure dose categories, uses angles in 1 increments with up to three images per position for noise sampling, and contains 2,187 images. Images are cropped and resized to 2 pixels, and 15% of viewing angles and corresponding images are sampled uniformly for test; training is unpaired across domains (Caetano et al., 29 Aug 2025).
Baselines include Hierarchy Flow among normalizing flows, CycleGAN-Turbo among GAN-based methods, and SDEdit and Z-STAR among diffusion-based translators. Evaluation uses CFID, Coverage, and CMMD for distributional realism, and LPIPS and SSIM for structure preservation. Task-driven metrics such as Dice and landmark error are explicitly not reported (Caetano et al., 29 Aug 2025).
The main quantitative pattern is a realism–structure trade-off controlled by 3.
| 4 | CFID / LPIPS / SSIM |
|---|---|
| 0.6 | 201.72±0.41 / 0.09±0.00 / 0.91±0.00 |
| 0.45 | 195.17±0.02 / 0.14±0.00 / 0.85±0.00 |
| 0.3 | 171.59±3.72 / 0.24±0.00 / 0.75±0.00 |
CycleGAN-Turbo achieves the strongest CFID, but the paper reports an anatomy cost, exemplified by CycleGAN-Turbo ss=1.0 with CFID 147.39 and SSIM 0.56. MedShift is reported to balance realism and structure across 5 settings, while Z-STAR preserves structure but under-transfers jaw style, and SDEdit shows its own structure–realism trade-off through noise strength (Caetano et al., 29 Aug 2025).
Ablation over 6 and CFG shows that increasing 7 raises SSIM from 0.75 at 8 to 0.91 at 9 and reduces LPIPS, while CFID worsens moderately. Increasing CFG decreases CFID but increases LPIPS and reduces SSIM. Qualitatively, the model improves attenuation realism, produces more natural noise and contrast, and recovers soft-tissue shading; at low 0, occasional hallucinations can occur, a failure mode compared to strong GAN stylization (Caetano et al., 29 Aug 2025).
The reported efficiency claims are also central. MedShift uses a compact latent-space U-Net rather than a full Stable Diffusion backbone, with approximate model sizes of 1.5 GB for MedShift, 7.1 GB for SDEdit, 6.2 GB for CycleGAN-Turbo, and 24.7 GB for Z-STAR. Reported latency at batch size 1 in FP32 is 0.45–0.77 s for MedShift, 0.67–1.63 s for SDEdit, and 8.78 s for Z-STAR; Hierarchy Flow is very fast and small but under-adapts (Caetano et al., 29 Aug 2025).
For reproducibility, the paper reports training on an NVIDIA RTX 3090 Ti (24 GB) with an Intel Xeon Silver 4216 and 192 GB RAM, mixed precision via Accelerate, learning rate 1, batch size 24, 1,000 epochs, warmup 100 steps, EMA 0.999, and the architecture settings listed above. Code and dataset are provided through the project page (Caetano et al., 29 Aug 2025).
6. Limitations, clinical considerations, and terminology
The reported limitations are primarily about structural reliability and dataset scope. Low-2 settings can hallucinate structures or over-sharpen soft tissue, and high CFG can degrade structural fidelity. The method is sensitive to domain labels and dose conditioning, so mis-specified labels may produce implausible style or contrast shifts. The benchmark is based on a skull phantom and a specific simulator and acquisition system, and rare pathologies and patient variability are underrepresented (Caetano et al., 29 Aug 2025).
Clinical use is therefore framed cautiously. Before deployment in downstream tasks, the paper recommends structural consistency checks such as SSIM, edge overlap, and landmark error, together with anatomy-preserving constraints and task-specific metrics such as segmentation Dice and registration accuracy. For structure-critical workflows, it recommends keeping 3 high and CFG moderate, with human-in-the-loop review (Caetano et al., 29 Aug 2025).
A common source of confusion is nomenclature. The name “MedShift” has also been used for an unsupervised framework for dataset shift identification in medical imaging that distinguishes prevalence, covariate, and mixed shifts (Roschewitz et al., 2024), and for a privacy-preserving pipeline that identifies shift data for medical dataset curation using per-class anomaly detectors (Guo et al., 2021). More broadly, medical distribution shift is surveyed as a cross-cutting deployment problem spanning joint training, federated learning, fine-tuning, and domain generalization (Su et al., 2024). In this terminological landscape, MedShift in the sense of (Caetano et al., 29 Aug 2025) specifically denotes latent-space conditional transport for synthetic-to-real skull X-ray adaptation, not generic shift detection or dataset monitoring.
Within that specific meaning, MedShift occupies a distinct position: it combines conditional Flow Matching with a Schrödinger-Bridge-motivated transport view, operates in a shared latent manifold, uses FM-only training with deterministic ODE sampling, and exposes post-training controls that let inference move along a continuum between structural preservation and target-domain stylization (Caetano et al., 29 Aug 2025).