A High-Compression Transformer VAE for Efficient and Controllable 3D Medical Image Generation with Diffusion Transformers
Organizations: University of California, San Francisco · California Institute of Technology
Abstract
Many medical image processing tasks, such as completing missing regions or correcting acquisition artifacts, can be cast as volumetric generation conditioned on observations of the same patient. Diffusion Transformers offer scalable capacity and flexible conditioning for this setting, but they operate on a learned image representation that must preserve fine anatomical and pathological detail while keeping complete three-dimensional volumes tractable. We bring Transformer variational autoencoding and multimodal diffusion together to address this challenge. Trained on BrainTumor-256K, a 249M Transformer VAE encodes and decodes volumes 7.6x faster than a comparably sized CNN trained on the same collection. Their PSNR difference is near zero with training-sized crop inputs, but the Transformer leads by 0.749 dB with full-volume inputs and an unchanged scoring region. Increasing Transformer capacity to 499M improves PSNR across all four brain MRI evaluation sets while retaining 3.8x lower encoding-decoding latency than the CNN. Fast encoding also allows conditions to be constructed dynamically in image space during latent diffusion training. Within the compressed representation, a shared Diffusion Transformer integrates text and spatial references for volumetric synthesis, completion and restoration. The brain-trained autoencoder further transfers to non-brain MRI and CT without target-domain fine-tuning, extending its use beyond the anatomy and modality on which it was learned. The framework provides a reusable representation and conditioning interface for efficient, controllable medical image generation. Code is available at https://github.com/OncoMMAI/brainmri-vit-vae3d.
Figures & tables
| Model | BraTS | OASIS | IXI | BrainTumor- 256K | Compression | Spatial Reduction | Channel | Element Reduction |
|---|---|---|---|---|---|---|---|---|
| ViT-VAE 500M | 33.53 | 32.16 | 35.46 | 33.80 | 512 | 16 | 32 | |
| ViT-VAE 250M | 32.55 | 31.13 | 34.08 | 32.95 | 512 | 16 | 32 | |
| CNN VAE 247M | 32.46 | 30.06 | 33.82 | 32.18 | 512 | 16 | 32 | |
| CogVideoX | 29.62 | 28.71 | 24.46 | 28.91 | 256 | 16 | 16 | |
| HunyuanVideo | 29.83 | 28.72 | 30.79 | 28.78 | 256 | 16 | 16 | |
| Wan | 29.18 | 28.20 | 30.30 | 28.04 | 256 | 16 | 16 |
| Model | Params (M) | ms | ms | ms | TFLOPs |
|---|---|---|---|---|---|
| ViT-VAE 500M | 499.3 | 38.7 | 574.0 | 4960.3 | 208.64 |
| ViT-VAE 250M | 249.2 | 19.6 | 288.5 | 2485.5 | 104.29 |
| CNN VAE 247M | 246.5 | 249.7 | 2195.7 | OOM | 387.49 |
| Dataset | ViT-VAE 500M | ViT-VAE 250M | CNN VAE | HunyuanVideo |
|---|---|---|---|---|
| AMOS MRI | 34.49 | 33.71 | 32.69 | 33.23 |
| Knee MRI | 29.20 | 28.69 | 28.49 | 28.46 |
| Heart MRI | 34.75 | 34.10 | 32.57 | 33.20 |
| Prostate MRI | 29.95 | 29.05 | 27.92 | 28.52 |
| Liver CT | 35.49 | 35.22 | 35.53 | 36.65 |
| Lung CT | 29.09 | 28.82 | 28.82 | 29.21 |
| Model | Reference | T1 | T1ce | T2 | FLAIR |
|---|---|---|---|---|---|
| Modality-controlled | |||||
| NV-Generate | Internal | 47.73 | – | 44.19 | 48.20 |
| NV-Generate | BraTS | 66.80 | – | 34.12 | 38.88 |
| MONAI BraTS-LDM | Internal | – | – | – | 63.84 |
| MONAI BraTS-LDM | BraTS | – | – | – | 51.66 |
| WDM | Internal | 123.36 | – | – | – |
Appendix figures & tables37 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | Value |
|---|---|
| Training steps | 462k |
| Examples processed | 29.6M |
| Training compute | 900–1,000 H200 GPU-hours |
| Effective batch size | 64 |
| Optimizer | AdamW ( Loshchilov and Hutter, 2019 ) , , weight decay 0.01 |
| Learning rate | , constant, no warmup |
| Reduction / channels | Spatial positions | Scalar elements | Grid ratio | Element ratio |
|---|---|---|---|---|
| / C16 | 32,768 | 524,288 | 512 | 32 |
| / C16 | 65,536 | 1,048,576 | 256 | 16 |
| / C32 | 32,768 | 1,048,576 | 512 | 16 |
| / C1 | 32,768 | 32,768 | 512 | 512 |
| Model | Params M | Latent type | Factors | Grid ratio | Element ratio | |
|---|---|---|---|---|---|---|
| ViT-VAE 500M | 499.3 | Gaussian | 8/8/8 | 16 | 512 | 32.0 |
| ViT-VAE 250M | 249.2 | Gaussian | 8/8/8 | 16 | 512 | 32.0 |
| CNN VAE 247M | 246.5 | Gaussian | 8/8/8 | 16 | 512 | 32.0 |
| HunyuanVideo | 246.5 | Gaussian | 4/8/8 | 16 | 256 | 16.0 |
| Wan | 126.9 | Gaussian | 4/8/8 | 16 | 256 | 16.0 |
| CogVideoX | 215.6 | Gaussian | 4/8/8 | 16 | 256 | 16.0 |
| Model | Params (M) | ms | ms | ms | Policy |
|---|---|---|---|---|---|
| ViT-VAE 500M | 499.3 | 38.7 | 574.0 | 4960.3 | Whole volume |
| ViT-VAE 250M | 249.2 | 19.6 | 288.5 | 2485.5 | Whole volume |
| CNN VAE 247M | 246.5 | 249.7 | 2195.7 | OOM | Whole volume |
| HunyuanVideo | 246.5 | 476.5 | 3685.3 | 12222.7 | Whole volume |
| Wan | 126.9 | 440.1 | 1872.2 | 5947.6 | Whole volume |
| CogVideoX | 215.6 | 447.6 | 3295.0 | 10905.5 | Whole volume |
| Model | Edge | Encoder ms | Peak GiB | TFLOPs |
|---|---|---|---|---|
| ViT-VAE 500M | 128 | 4.3 | 2.12 | 0.688 |
| ViT-VAE 500M | 256 | 56.7 | 3.40 | 20.893 |
| ViT-VAE 500M | 384 | 499.1 | 6.90 | 211.526 |
| ViT-VAE 250M | 128 | 4.3 | 1.14 | 0.686 |
| ViT-VAE 250M | 256 | 57.4 | 2.43 | 20.880 |
| ViT-VAE 250M | 384 | 501.3 | 5.92 | 211.482 |
| Model | Edge | Encode | Decode | Full |
|---|---|---|---|---|
| ViT-VAE 500M | 128 | 0.688 | 6.151 | 6.838 |
| ViT-VAE 500M | 256 | 20.893 | 187.743 | 208.636 |
| ViT-VAE 500M | 384 | 211.526 | 1902.743 | 2114.269 |
| ViT-VAE 250M | 128 | 0.686 | 2.730 | 3.415 |
| ViT-VAE 250M | 256 | 20.880 | 83.409 | 104.289 |
| ViT-VAE 250M | 384 | 211.482 | 845.556 | 1057.038 |
| Backbone | Params (M) | Step (ms) | Samples/s | B1 peak alloc. (GiB) | Largest tested batch |
|---|---|---|---|---|---|
| ViT-VAE 500M | 499.3 | 129.6 | 7.7 | 15.3 | 8 |
| ViT-VAE 250M | 249.2 | 65.9 | 15.2 | 13.4 | 16 |
| CNN VAE 247M | 246.5 | 508.2 | 2.0 | 47.3 | 2 |
| Dataset | Distinct shapes | Axis ranges | Max. aspect | |
|---|---|---|---|---|
| BraTS | 800 | 1 | 155–155/240–240/240–240 | 1.55 |
| OASIS | 562 | 1 | 160–160/256–256/256–256 | 1.60 |
| IXI | 200 | 4 | 144–180/240–240/240–240 | 1.67 |
| BrainTumor-256K | 400 | 1 | 189–189/233–233/197–197 | 1.23 |
| AMOS MRI | 101 | 36 | 175–500/120–400/346–500 | 3.75 |
| Knee MRI | 320 | 21 | 84–150/140–140/140–140 | 1.67 |
| Dataset | ViT-VAE 500M | ViT-VAE 250M | CNN VAE 247M |
|---|---|---|---|
| BraTS | 33.53 | 32.55 | 32.46 |
| OASIS | 32.16 | 31.13 | 30.06 |
| IXI | 35.46 | 34.08 | 33.82 |
| BrainTumor-256K | 33.80 | 32.95 | 32.18 |
| AMOS MRI | 34.49 | 33.71 | 32.69 |
| Knee MRI | 29.20 | 28.69 | 28.49 |
| Dataset | ViT-VAE 500M | ViT-VAE 250M | CNN VAE 247M |
|---|---|---|---|
| BraTS | 0.9968 | 0.9962 | 0.9942 |
| OASIS | 0.9972 | 0.9965 | 0.9949 |
| IXI | 0.9985 | 0.9980 | 0.9971 |
| BrainTumor-256K | 0.9960 | 0.9953 | 0.9940 |
| AMOS MRI | 0.9939 | 0.9931 | 0.9920 |
| Knee MRI | 0.9764 | 0.9741 | 0.9730 |
| Dataset | ViT-VAE 500M | ViT-VAE 250M | CNN VAE 247M |
|---|---|---|---|
| BraTS | 0.9684 | 0.9636 | 0.9543 |
| OASIS | 0.9694 | 0.9627 | 0.9529 |
| IXI | 0.9853 | 0.9810 | 0.9760 |
| BrainTumor-256K | 0.9666 | 0.9621 | 0.9553 |
| AMOS MRI | 0.9543 | 0.9480 | 0.9425 |
| Knee MRI | 0.8035 | 0.7918 | 0.7890 |
| Dataset | ViT-VAE 500M | ViT-VAE 250M | CNN VAE 247M |
|---|---|---|---|
| BraTS | 0.0399 | 0.0474 | 0.0460 |
| OASIS | 0.0485 | 0.0575 | 0.0636 |
| IXI | 0.0296 | 0.0371 | 0.0356 |
| BrainTumor-256K | 0.0635 | 0.0726 | 0.0708 |
| AMOS MRI | 0.0872 | 0.0957 | 0.1033 |
| Knee MRI | 0.2005 | 0.2067 | 0.1930 |
| Model | Liver | Lung | Pancreas | KiTS19 |
|---|---|---|---|---|
| ViT-VAE 500M | 35.49 | 29.09 | 36.33 | 36.46 |
| ViT-VAE 250M | 35.22 | 28.82 | 35.80 | 36.16 |
| CNN VAE 247M | 35.53 | 28.82 | 34.64 | 35.56 |
| HunyuanVideo | 36.65 | 29.21 | 37.32 | 37.86 |
| Wan | 35.54 | 28.60 | 36.30 | 36.33 |
| CONFLUX | 28.42 | 25.95 | 26.42 | 25.30 |
| Model | Liver | Lung | Pancreas | KiTS19 |
|---|---|---|---|---|
| ViT-VAE 500M | 0.9885 | 0.9671 | 0.9919 | 0.9899 |
| ViT-VAE 250M | 0.9885 | 0.9660 | 0.9919 | 0.9902 |
| CNN VAE 247M | 0.9897 | 0.9668 | 0.9911 | 0.9908 |
| HunyuanVideo | 0.9908 | 0.9688 | 0.9933 | 0.9924 |
| Wan | 0.9889 | 0.9642 | 0.9915 | 0.9909 |
| CONFLUX | 0.9376 | 0.9089 | 0.9185 | 0.9360 |
| Model | Liver | Lung | Pancreas | KiTS19 |
|---|---|---|---|---|
| ViT-VAE 500M | 0.9141 | 0.7611 | 0.9400 | 0.9282 |
| ViT-VAE 250M | 0.9141 | 0.7582 | 0.9394 | 0.9293 |
| CNN VAE 247M | 0.9207 | 0.7637 | 0.9349 | 0.9346 |
| HunyuanVideo | 0.9244 | 0.7637 | 0.9466 | 0.9396 |
| Wan | 0.9124 | 0.7402 | 0.9338 | 0.9278 |
| CONFLUX | 0.7393 | 0.5504 | 0.6779 | 0.7675 |
| Model | Liver | Lung | Pancreas | KiTS19 |
|---|---|---|---|---|
| ViT-VAE 500M | 0.1385 | 0.1930 | 0.1154 | 0.1367 |
| ViT-VAE 250M | 0.1442 | 0.1873 | 0.1214 | 0.1401 |
| CNN VAE 247M | 0.1132 | 0.1739 | 0.1087 | 0.1029 |
| HunyuanVideo | 0.1150 | 0.1713 | 0.0851 | 0.1018 |
| Wan | 0.1221 | 0.1662 | 0.0936 | 0.1128 |
| CONFLUX | 0.4377 | 0.6297 | 0.4362 | 0.4752 |
| Input to segmenter | WT | TC | ET |
|---|---|---|---|
| Original | 83.26 | 84.92 | 82.98 |
| ViT-VAE 500M | 84.22 | 83.27 | 81.16 |
| HunyuanVideo | 84.52 | 82.88 | 80.68 |
| Comparator | Region | Patients | Difference | 95% interval |
|---|---|---|---|---|
| Original | WT | 165 | +0.96 | [+0.12, +1.76] |
| Original | TC | 165 | -1.66 | [-2.87, -0.64] |
| Original | ET | 158 | -1.82 | [-2.84, -0.96] |
| HunyuanVideo | WT | 165 | -0.30 | [-0.78, +0.32] |
| HunyuanVideo | TC | 165 | +0.38 | [+0.10, +0.69] |
| HunyuanVideo | ET | 158 | +0.48 | [+0.02, +0.91] |
| DiT | Interface | Tokens | Step ms | SD ms | Alloc. GiB | Res. GiB |
|---|---|---|---|---|---|---|
| 633M | f8/C16 (ours, CNN VAE) | 1,296 | 64.8 | 0.3 | 9.85 | 10.93 |
| 633M | (4,8,8)/C16 (video VAEs) | 2,592 | 70.9 | 5.8 | 11.31 | 12.40 |
| 633M | f4/C4 (MAISI), p2 | 10,368 | 946.2 | 79.0 | 19.70 | 20.66 |
| 988M | f8/C16 (ours, CNN VAE) | 1,296 | 67.4 | 0.2 | 14.85 | 18.12 |
| 988M | (4,8,8)/C16 (video VAEs) | 2,592 | 78.9 | 0.1 | 16.55 | 18.99 |
| 2.01B | f8/C16 (ours, CNN VAE) | 1,296 | 113.2 | 0.2 | 30.23 | 36.26 |
| Task | Spatial condition | Synthesis target |
|---|---|---|
| Sequence control | None | Requested MRI contrast |
| Lesion-mask guidance | Tumor-label map | MRI following lesion geometry |
| Inpainting | Observed image and hole | Completed image |
| Deblurring | Blurred image | Sharp image |
| De-aliasing | Undersampled-image reference | Corrected image |
| Motion correction | Motion-corrupted image | Corrected image |
| Task | Method | LPIPS | MS-SSIM | FID | FRD |
|---|---|---|---|---|---|
| Inpainting | Zhang25 | 0.069 | 0.961 | 0.28 | 7.54 |
| Ours | 0.063 | 0.941 | 0.18 | 5.32 | |
| Deblurring | Degraded input | 0.808 | 0.959 | 76.20 | 25.77 |
| Ours | 0.222 | 0.965 | 23.95 | 5.83 | |
| De-aliasing | Degraded input | 0.847 | 0.627 | 198.30 | 8.66 |
| Ours | 0.670 | 0.759 | 154.29 | 6.52 |
| Task | Metric | Mean | 95% interval |
|---|---|---|---|
| Inpainting | PSNR | 20.262 | [19.660, 20.863] |
| Inpainting | MS-SSIM | 0.918 | [0.906, 0.930] |
| Inpainting | SSIM | 0.763 | [0.741, 0.784] |
| Inpainting | LPIPS | 0.175 | [0.165, 0.187] |
| Deblurring | PSNR | 20.303 | [20.097, 20.513] |
| Deblurring | MS-SSIM | 0.965 | [0.962, 0.967] |
| Task | Method | PSNR | MS-SSIM | SSIM | LPIPS |
|---|---|---|---|---|---|
| Inpainting | Zhang25 | 24.87 | 0.960 | 0.929 | 0.075 |
| Inpainting | Ours | 20.26 | 0.918 | 0.763 | 0.175 |
| Deblurring | Degraded input | 20.97 | 0.959 | 0.795 | 0.808 |
| Deblurring | Ours | 20.30 | 0.965 | 0.818 | 0.222 |
| De-aliasing | Degraded input | 10.77 | 0.627 | 0.442 | 0.847 |
| De-aliasing | Ours | 15.86 | 0.759 | 0.335 | 0.670 |
| Inpainting evaluation | Ours FID | Zhang25 FID |
|---|---|---|
| Raw complete output | 8.2548 | 0.2770 |
| Reference-outside composite | 0.1776 | 0.2768 |
| De-aliasing output | PSNR | MS-SSIM | SSIM | LPIPS | FID |
|---|---|---|---|---|---|
| Raw | 15.859 | 0.759 | 0.335 | 0.670 | 154.29 |
| Brain-support masked | 15.859 | 0.891 | 0.726 | 0.226 | 21.23 |
| Task | Method | PSNR | MS-SSIM | SSIM | LPIPS | Valid (P/M/S/L) |
|---|---|---|---|---|---|---|
| Deblurring | Input | 25.785 | 0.935 | 0.705 | 0.953 | 100/84/99/93 |
| Deblurring | Ours | 23.615 | 0.939 | 0.682 | 0.349 | 100/84/99/93 |
| De-aliasing | Input | 12.378 | 0.620 | 0.454 | 0.730 | 100/84/99/93 |
| De-aliasing | Ours | 15.737 | 0.723 | 0.404 | 0.529 | 100/84/99/93 |
| Motion correction | Input | 11.331 | 0.700 | 0.483 | 0.665 | 100/84/99/93 |
| Motion correction | Ours | 17.233 | 0.788 | 0.505 | 0.361 | 100/84/99/93 |
| Task / region | FRD ( ) |
|---|---|
| Healthy-region inpainting / outside hole | 4.071 |
| Pseudo-healthy synthesis / outside lesion | 4.200 |
| Segmentation-detected residual | Mean | Median |
|---|---|---|
| Fraction within the conditioned region | 0.209 | 0.024 |
| Fraction over the full volume | 0.255 | 0.082 |
| Residual within region : 9/20; : 11/20. | ||
| Model | Dice | Precision | Recall | Volume ratio |
|---|---|---|---|---|
| Ours | 0.824 | 0.766 | 0.911 | 1.275 |
| Med-DDPM | 0.847 | 0.844 | 0.867 | 1.052 |
Medical Image Synthesis
Medical image synthesis creates, translates, reconstructs, and edits clinical images to fill missing data and support analysis.
See all 345 papers