Views
No views yet
Accepted at [Medical Image Understanding and Analysis (MIUA) 2025]

1git clone https://github.com/BioMedIA-MBZUAI/RobustMedCLIP.git
2cd RobustMedCLIP
3conda create -n robustmedclip python=3.12.7
4conda activate robustmedclip
5pip install -r requirements.txt
6pip install hugginface_hub<YOUR-HUGGINGFACE-TOKEN> with your personal Hugging Face access token, to directly download Datasets and Model Weights.Settings, then click on the Access Tokens tab. Click on the New token button to create a new User Access Token.1huggingface-cli download razaimam45/RobustMedCLIP \
2 --local-dir ./outputs \
3 --repo-type model \
4 --token <YOUR-HUGGINGFACE-TOKEN>Outputs Folder Structure: The outputs/ folder (should be in root folder) contains all trained model weights and evaluation results:1outputs/
2├── checkpoints/ # Baseline MVLMs (MedCLIP, UniMedCLIP)
3├── exp-rank-8/ # RobustMedCLIP (LoRA Rank = 8) for ViT and ResNet across few-shots (1/3/7/10)%
4├── exp-rank-16/ # RobustMedCLIP (LoRA Rank = 16) for ViT and ResNet across few-shots (1/3/7/10)%
5└── results/ # Evaluation logs across mCE/Accuracy metrics| Dataset | Modality | Clean Samples | Corruption Sets | Resolution |
|---|---|---|---|---|
| MediMeta-C | Multi-modality | 5 Modalities | 7 corruptions × 5 levels | High-res |
| MedMNIST-C | Public Benchmark | 5 Modalities | 7 corruptions × 5 levels | Low-res |
1MediMeta-C/
2├── pbc/ # Blood Cell modality
3│ ├── test/ # Test set
4│ │ ├── clean.npz # Clean samples
5│ │ ├── brightness_severity_1.npz
6│ │ ├── brightness_severity_2.npz
7│ │ ├── ... # Other severity levels
8│ │ └── brightness_severity_5.npz
9│ ├── val/ # Validation set
10│ ├── clean.npz
11│ ├── contrast_severity_1.npz
12│ ├── contrast_severity_2.npz
13│ ├── ... # Other severity levels
14│ └── contrast_severity_5.npz
15├── fundus/ # Fundus modality
16│ ├── test/
17│ ├── val/
18│ └── ... # Similar structure as above
19├── ... # Other modalities
20└── README.md # Dataset descriptiondata/MediMeta-C should be in the root of the project folder.huggingface-cli download razaimam45/MediMeta-C --local-dir ./data/MediMeta-C --repo-type dataset --token <YOUR-HUGGINGFACE-TOKEN>1# Fine-tune with ViT backbone (e.g., BioMedCLIP)
2bash scripts/run_finetune_vit.sh
3
4# Fine-tune with ResNet backbone (e.g., MedCLIP)
5bash scripts/run_finetune_resnet.sh1# Evaluation for RobustMedCLIP (RMC)
2bash scripts/run_eval_rmed.sh
3
4# Custom evaluation on other models (rmedclip, biomedclip, unimedclip, medclip, clip)
5python evaluate.py --model rmedclip \
6 --backbone vit \
7 --gpu 0 --corruptions all --collection medimeta | Model | Clean Error ↓ | mCE ↓ (avg) |
|---|---|---|
| CLIP | 100.0 | 100.0 |
| MedCLIP | 106.4 | 112.5 |
| BioMedCLIP | 116.3 | 126.8 |
| UniMedCLIP | 111.8 | 98.87 |
| RMedCLIP | 62.8 | 81.0 |
Results and Discussions.1@misc{imam2025robustnessmedicalvisionlanguagemodels,
2 title={On the Robustness of Medical Vision-Language Models: Are they Truly Generalizable?},
3 author={Raza Imam and Rufael Marew and Mohammad Yaqub},
4 year={2025},
5 eprint={2505.15425},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2505.15425},
9}