Explaining Medical Image Classifiers with Visual Question Answering Models:
a Visual Question Answering (VQA) Model trained on medical data
Deep learning has shown promising potential for Medical Image Classification and Diagnosing. But added to the limitations of annotated training data in the medical domain, explanations for the models's predictions are also desired in this field of application.
Using Flamingo, a Visual Language Model for Few-Shot Learning, we leverage big pre-trained language models and vision encoders to build a new VQA model that can answers question for Xray images.
You can find out available pre-trained Models under the following link
For Backbone training used datasets are as follows:
For Medical VQA
Using Flamingo's architecture elements, we built a model capable of taking an Xray image and any question as inputs in order to generate an answer to the asked question.
A simplified overview of our model architectures is given in the following figures :


Check out flamingo_clip_gpt2_vqa_rad_run.py
Hardware: 1 A40 GPU, 80 epochs with early stop on val loss (at around 40 each experiment)
Duration: ~30 mins
LR: 1e-5
LR Warmup: 30 Steps
Loss: Cross Entropy Loss
Testing: check out vqaRAD_flamingo_clip_gpt2_infer.ipynb:
Check out flamingo_clip_gpt2_imageclef_run.py:
Hardware: 1 A40 GPU, 200 epochs with early stop on val loss (at around 110 each experiment)
Duration: ~3 hours
LR: 1e-4
LR Warmup: 30 Steps
Loss: Cross Entropy Loss
Testing: check out Imageclef_flamingo_clip_gpt2_playground.ipynb:
To make it easy for you to get started with our model, here's a list of recommended next steps:
cd local/path
git clone https://gitlab.lrz.de/CAMP_IFL/diva/mlmi-vqa
conda.conda env create -f environment.yml
conda activate mlmi
You can check and try out our model in our demo page using the QR code To run the demo check demo_imageclef.ipynb
At the moment we are still closed for contributions.
Authors: Fabian Scherer - Andrei Mancu - Alaeddine Mellouli - Çağhan Köksal
We thank the MLMI team and both Matthias Keicher and Kamilia Zaripova for their help and support.
Private Repository until further development.
Jupyter Notebook
96.6%
Python
3.4%
Explaining Medical Image Classifiers with Visual Question Answering Models:
a Visual Question Answering (VQA) Model trained on medical data
Deep learning has shown promising potential for Medical Image Classification and Diagnosing. But added to the limitations of annotated training data in the medical domain, explanations for the models's predictions are also desired in this field of application.
Using Flamingo, a Visual Language Model for Few-Shot Learning, we leverage big pre-trained language models and vision encoders to build a new VQA model that can answers question for Xray images.
You can find out available pre-trained Models under the following link
For Backbone training used datasets are as follows:
For Medical VQA
Using Flamingo's architecture elements, we built a model capable of taking an Xray image and any question as inputs in order to generate an answer to the asked question.
A simplified overview of our model architectures is given in the following figures :


Check out flamingo_clip_gpt2_vqa_rad_run.py
Hardware: 1 A40 GPU, 80 epochs with early stop on val loss (at around 40 each experiment)
Duration: ~30 mins
LR: 1e-5
LR Warmup: 30 Steps
Loss: Cross Entropy Loss
Testing: check out vqaRAD_flamingo_clip_gpt2_infer.ipynb:
Check out flamingo_clip_gpt2_imageclef_run.py:
Hardware: 1 A40 GPU, 200 epochs with early stop on val loss (at around 110 each experiment)
Duration: ~3 hours
LR: 1e-4
LR Warmup: 30 Steps
Loss: Cross Entropy Loss
Testing: check out Imageclef_flamingo_clip_gpt2_playground.ipynb:
To make it easy for you to get started with our model, here's a list of recommended next steps:
cd local/path
git clone https://gitlab.lrz.de/CAMP_IFL/diva/mlmi-vqa
conda.conda env create -f environment.yml
conda activate mlmi
You can check and try out our model in our demo page using the QR code To run the demo check demo_imageclef.ipynb
At the moment we are still closed for contributions.
Authors: Fabian Scherer - Andrei Mancu - Alaeddine Mellouli - Çağhan Köksal
We thank the MLMI team and both Matthias Keicher and Kamilia Zaripova for their help and support.
Private Repository until further development.
Jupyter Notebook
96.6%
Python
3.4%