The official code for "Towards Generalist Foundation Model for Radiology"
In this project, we collect a large-scale medical multi-modal dataset, MedMD, with 16M 2D or 3D images. We train a new medical multi-modal generative model RadFM on it, enabling both 2D and 3D scans, multi-image input and visual-language interleaving cases.
For quick start, you can check the Quick_demo path.
We demonstrate a simple diagnosis case here to show how to inference with our model.
Feel free to modify it as you want.
-
S1. Download Model checkpoint.
-
S2. Decompress the original zip file, you can get a
pytorch_model.bin. -
S3. put
pytorch_model.binunder pathQuick_demo/. -
S4. python
test.pyand you can get a conversation as:Input:
Can you identify any visible signs of Cardiomegaly in the image?
Output: yes
By the way, never try to perform this in cpu and gpu is all you need :).
For re-training a model on our dataset or large-scale testing our pre-train model, you can check src.
Simply, train.py for training and test.py for testing.
- Check the data_csv to get how different datasets are processed and download them into
src/Dataset/data_csv - Modify the path as you disire, and check
src/train.pyto pre-train orsrc/train.pyto test.
Some cases produced by our final model:
MedKD Dataset downloading URL:
- Polish the code in
srcfor eaiser reading. - upload huggingface version.
We sincerely thank all the contributors who uploaded the relevant data in our dataset online. We appreciate their willingness to make these valuable cases publicly available.
If you have any questions, please feel free to contact wtzxxxwcy02@sjtu.edu.cn.



