MedVAE
MedVAE is a family of six large-scale, generalizable 2D and 3D variational autoencoders (VAEs) designed for medical imaging. It is trained on over one million medical images across multiple anatomical regions and modalities. MedVAE autoencoders encode medical images as downsized latent representations and decode latent representations back to high-resolution images. Across diverse tasks obtained from 20 medical image datasets, we demonstrate that utilizing MedVAE latent representations in place of high-resolution images when training downstream models can lead to efficiency benefits (up to 70x improvement in throughput) while simultaneously preserving clinically-relevant features.
π Model Description
Total Compression Factor | Channels | Dimensions | Modalities | Anatomies | Config File | Model File |
---|---|---|---|---|---|---|
16 | 1 | 2D | X-ray | Chest, Breast (FFDM) | medvae_4x1.yaml | vae_4x_1c_2D.ckpt |
16 | 3 | 2D | X-ray | Chest, Breast (FFDM) | medvae_4x3.yaml | vae_4x_3c_2D.ckpt |
64 | 1 | 2D | X-ray | Chest, Breast (FFDM) | medvae_8x1.yaml | vae_8x_1c_2D.ckpt |
64 | 3 | 2D | X-ray | Chest, Breast (FFDM) | medvae_8x4.yaml | vae_8x_4c_2D.ckpt |
64 | 1 | 3D | MRI, CT | Whole-Body | medvae_4x1.yaml | vae_4x_1c_3D.ckpt |
512 | 1 | 3D | MRI, CT | Whole-Body | medvae_8x1.yaml | vae_8x_1c_3D.ckpt |
Note: Model weights and checkpoints are located in the model_weights
folder.
β‘οΈ Installation
To install MedVAE, you can simply run:
pip install medvae
For an editable installation, use the following commands to clone and install this repository.
git clone https://github.com/StanfordMIMI/MedVAE.git
cd medvae
pip install -e .[dev]
π Usage Instruction
We allow for easy-to-use CLI inference tool for compressing your high-dimensional medical images into usable latents:
medvae_inference -i INPUT_FOLDER -o OUTPUT_FOLDER -model_name MED_VAE_MODEL -modality MODALITY
π Citation
If you use MedVAE, please cite the original paper:
@article{varma2025medvae,
title = {MedVAE: Efficient Automated Interpretation of Medical Images with Large-Scale Generalizable Autoencoders},
author = {Maya Varma, Ashwin Kumar, Rogier van der Sluijs, Sophie Ostmeier, Louis Blankemeier, Pierre Chambon, Christian Bluethgen, Jip Prince, Curtis Langlotz, Akshay Chaudhari},
year = {2025},
publisher = {Github},
journal = {Github},
howpublished = {https://github.com/StanfordMIMI/MedVAE}
}
For questions, please place a Github Issues message.