Add files using upload-large-folder tool
Browse files- .gitattributes +1 -0
- README.md +545 -0
- RKllm.txt +0 -0
- medgemma-4b-pt.rkllm +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
medgemma-4b-pt.rkllm filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,545 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: other
|
3 |
+
license_name: health-ai-developer-foundations
|
4 |
+
license_link: https://developers.google.com/health-ai-developer-foundations/terms
|
5 |
+
library_name: rkllm
|
6 |
+
pipeline_tag: image-text-to-text
|
7 |
+
base_model:
|
8 |
+
- Prince-1/medgemma-4b-pt
|
9 |
+
tags:
|
10 |
+
- medical
|
11 |
+
- radiology
|
12 |
+
- clinical-reasoning
|
13 |
+
- dermatology
|
14 |
+
- pathology
|
15 |
+
- ophthalmology
|
16 |
+
- chest-x-ray
|
17 |
+
- rkllm
|
18 |
+
- rk3588
|
19 |
+
- rockchip
|
20 |
+
---
|
21 |
+
# MedGemma model card
|
22 |
+
|
23 |
+
**Model documentation:** [MedGemma](https://developers.google.com/health-ai-developer-foundations/medgemma)
|
24 |
+
|
25 |
+
**Resources:**
|
26 |
+
|
27 |
+
* Model on Google Cloud Model Garden: [MedGemma](https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/medgemma)
|
28 |
+
* Model on Hugging Face: [MedGemma](https://huggingface.co/collections/google/medgemma-release-680aade845f90bec6a3f60c4)
|
29 |
+
* GitHub repository (supporting code, Colab notebooks, discussions, and
|
30 |
+
issues): [MedGemma](https://github.com/google-health/medgemma)
|
31 |
+
* Quick start notebook: [GitHub](https://github.com/google-health/medgemma/blob/main/notebooks/quick_start_with_hugging_face.ipynb)
|
32 |
+
* Fine-tuning notebook: [GitHub](https://github.com/google-health/medgemma/blob/main/notebooks/fine_tune_with_hugging_face.ipynb)
|
33 |
+
* [Patient Education Demo built using MedGemma](https://huggingface.co/spaces/google/rad_explain)
|
34 |
+
* Support: See [Contact](https://developers.google.com/health-ai-developer-foundations/medgemma/get-started.md#contact)
|
35 |
+
* License: The use of MedGemma is governed by the [Health AI Developer
|
36 |
+
Foundations terms of
|
37 |
+
use](https://developers.google.com/health-ai-developer-foundations/terms).
|
38 |
+
**Author:** Google
|
39 |
+
|
40 |
+
## Model information
|
41 |
+
|
42 |
+
This section describes the MedGemma model and how to use it.
|
43 |
+
|
44 |
+
### Description
|
45 |
+
|
46 |
+
MedGemma is a collection of [Gemma 3](https://ai.google.dev/gemma/docs/core)
|
47 |
+
variants that are trained for performance on medical text and image
|
48 |
+
comprehension. Developers can use MedGemma to accelerate building
|
49 |
+
healthcare-based AI applications. MedGemma currently comes in two variants: a 4B
|
50 |
+
multimodal version and a 27B text-only version.
|
51 |
+
|
52 |
+
MedGemma 4B utilizes a [SigLIP](https://arxiv.org/abs/2303.15343) image encoder
|
53 |
+
that has been specifically pre-trained on a variety of de-identified medical
|
54 |
+
data, including chest X-rays, dermatology images, ophthalmology images, and
|
55 |
+
histopathology slides. Its LLM component is trained on a diverse set of medical
|
56 |
+
data, including radiology images, histopathology patches, ophthalmology images,
|
57 |
+
and dermatology images.
|
58 |
+
|
59 |
+
MedGemma 4B is available in both pre-trained (suffix: `-pt`) and
|
60 |
+
instruction-tuned (suffix `-it`) versions. The instruction-tuned version is a
|
61 |
+
better starting point for most applications. The pre-trained version is
|
62 |
+
available for those who want to experiment more deeply with the models.
|
63 |
+
|
64 |
+
MedGemma 27B has been trained exclusively on medical text and optimized for
|
65 |
+
inference-time computation. MedGemma 27B is only available as an
|
66 |
+
instruction-tuned model.
|
67 |
+
|
68 |
+
MedGemma variants have been evaluated on a range of clinically relevant
|
69 |
+
benchmarks to illustrate their baseline performance. These include both open
|
70 |
+
benchmark datasets and curated datasets. Developers can fine-tune MedGemma
|
71 |
+
variants for improved performance. Consult the Intended Use section below for
|
72 |
+
more details.
|
73 |
+
|
74 |
+
A full technical report will be available soon.
|
75 |
+
|
76 |
+
### How to use
|
77 |
+
|
78 |
+
Below are some example code snippets to help you quickly get started running the
|
79 |
+
model locally on GPU. If you want to use the model at scale, we recommend that
|
80 |
+
you create a production version using [Model
|
81 |
+
Garden](https://cloud.google.com/model-garden).
|
82 |
+
|
83 |
+
First, install the Transformers library. Gemma 3 is supported starting from
|
84 |
+
transformers 4.50.0.
|
85 |
+
|
86 |
+
```sh
|
87 |
+
$ pip install -U transformers
|
88 |
+
```
|
89 |
+
|
90 |
+
**Run model with the `pipeline` API**
|
91 |
+
|
92 |
+
```python
|
93 |
+
from transformers import pipeline
|
94 |
+
from PIL import Image
|
95 |
+
import requests
|
96 |
+
import torch
|
97 |
+
pipe = pipeline(
|
98 |
+
"image-text-to-text",
|
99 |
+
model="google/medgemma-4b-pt",
|
100 |
+
torch_dtype=torch.bfloat16,
|
101 |
+
device="cuda",
|
102 |
+
)
|
103 |
+
# Image attribution: Stillwaterising, CC0, via Wikimedia Commons
|
104 |
+
image_url = "https://upload.wikimedia.org/wikipedia/commons/c/c8/Chest_Xray_PA_3-8-2010.png"
|
105 |
+
image = Image.open(requests.get(image_url, headers={"User-Agent": "example"}, stream=True).raw)
|
106 |
+
output = pipe(
|
107 |
+
images=image,
|
108 |
+
text="<start_of_image> findings:",
|
109 |
+
max_new_tokens=100,
|
110 |
+
)
|
111 |
+
print(output[0]["generated_text"])
|
112 |
+
```
|
113 |
+
|
114 |
+
**Run the model directly**
|
115 |
+
|
116 |
+
```python
|
117 |
+
# pip install accelerate
|
118 |
+
from transformers import AutoProcessor, AutoModelForImageTextToText
|
119 |
+
from PIL import Image
|
120 |
+
import requests
|
121 |
+
import torch
|
122 |
+
model_id = "google/medgemma-4b-pt"
|
123 |
+
model = AutoModelForImageTextToText.from_pretrained(
|
124 |
+
model_id,
|
125 |
+
torch_dtype=torch.bfloat16,
|
126 |
+
device_map="auto",
|
127 |
+
)
|
128 |
+
processor = AutoProcessor.from_pretrained(model_id)
|
129 |
+
# Image attribution: Stillwaterising, CC0, via Wikimedia Commons
|
130 |
+
image_url = "https://upload.wikimedia.org/wikipedia/commons/c/c8/Chest_Xray_PA_3-8-2010.png"
|
131 |
+
image = Image.open(
|
132 |
+
requests.get(image_url, headers={"User-Agent": "example"}, stream=True).raw
|
133 |
+
).convert("RGB")
|
134 |
+
prompt = "<start_of_image> findings:"
|
135 |
+
inputs = processor(
|
136 |
+
text=prompt, images=image, return_tensors="pt"
|
137 |
+
).to(model.device, dtype=torch.bfloat16)
|
138 |
+
input_len = inputs["input_ids"].shape[-1]
|
139 |
+
with torch.inference_mode():
|
140 |
+
generation = model.generate(**inputs, max_new_tokens=100, do_sample=False)
|
141 |
+
generation = generation[0][input_len:]
|
142 |
+
decoded = processor.decode(generation, skip_special_tokens=True)
|
143 |
+
print(decoded)
|
144 |
+
```
|
145 |
+
|
146 |
+
### Examples
|
147 |
+
|
148 |
+
See the following Colab notebooks for examples of how to use MedGemma:
|
149 |
+
|
150 |
+
* To give the model a quick try, running it locally with weights from Hugging
|
151 |
+
Face, see [Quick start notebook in
|
152 |
+
Colab](https://colab.research.google.com/github/google-health/medgemma/blob/main/notebooks/quick_start_with_hugging_face.ipynb).
|
153 |
+
Note that you will need to use Colab Enterprise to run the 27B model without
|
154 |
+
quantization.
|
155 |
+
* For an example of fine-tuning the model, see the [Fine-tuning notebook in
|
156 |
+
Colab](https://colab.research.google.com/github/google-health/medgemma/blob/main/notebooks/fine_tune_with_hugging_face.ipynb).
|
157 |
+
### Model architecture overview
|
158 |
+
|
159 |
+
The MedGemma model is built based on [Gemma 3](https://ai.google.dev/gemma/) and
|
160 |
+
uses the same decoder-only transformer architecture as Gemma 3. To read more
|
161 |
+
about the architecture, consult the Gemma 3 [model
|
162 |
+
card](https://ai.google.dev/gemma/docs/core/model_card_3).
|
163 |
+
|
164 |
+
### Technical specifications
|
165 |
+
|
166 |
+
* **Model type**: Decoder-only Transformer architecture, see the [Gemma 3
|
167 |
+
technical
|
168 |
+
report](https://storage.googleapis.com/deepmind-media/gemma/Gemma3Report.pdf)
|
169 |
+
* **Modalities**: **4B**: Text, vision; **27B**: Text only
|
170 |
+
* **Attention mechanism**: Utilizes grouped-query attention (GQA)
|
171 |
+
* **Context length**: Supports long context, at least 128K tokens
|
172 |
+
* **Key publication**: Coming soon
|
173 |
+
* **Model created**: May 20, 2025
|
174 |
+
* **Model version**: 1.0.0
|
175 |
+
### Citation
|
176 |
+
|
177 |
+
A technical report is coming soon. In the meantime, if you publish using this
|
178 |
+
model, please cite the Hugging Face model page:
|
179 |
+
|
180 |
+
```none
|
181 |
+
@misc{medgemma-hf,
|
182 |
+
author = {Google},
|
183 |
+
title = {MedGemma Hugging Face}
|
184 |
+
howpublished = {\url{https://huggingface.co/collections/google/medgemma-release-680aade845f90bec6a3f60c4}},
|
185 |
+
year = {2025},
|
186 |
+
note = {Accessed: [Insert Date Accessed, e.g., 2025-05-20]}
|
187 |
+
}
|
188 |
+
```
|
189 |
+
|
190 |
+
### Inputs and outputs
|
191 |
+
|
192 |
+
**Input**:
|
193 |
+
|
194 |
+
* Text string, such as a question or prompt
|
195 |
+
* Images, normalized to 896 x 896 resolution and encoded to 256 tokens each
|
196 |
+
* Total input length of 128K tokens
|
197 |
+
|
198 |
+
**Output**:
|
199 |
+
|
200 |
+
* Generated text in response to the input, such as an answer to a question,
|
201 |
+
analysis of image content, or a summary of a document
|
202 |
+
* Total output length of 8192 tokens
|
203 |
+
### Performance and validation
|
204 |
+
|
205 |
+
MedGemma was evaluated across a range of different multimodal classification,
|
206 |
+
report generation, visual question answering, and text-based tasks.
|
207 |
+
|
208 |
+
### Key performance metrics
|
209 |
+
|
210 |
+
#### Imaging evaluations
|
211 |
+
|
212 |
+
The multimodal performance of MedGemma 4B was evaluated across a range of
|
213 |
+
benchmarks, focusing on radiology, dermatology, histopathology, ophthalmology,
|
214 |
+
and multimodal clinical reasoning.
|
215 |
+
|
216 |
+
MedGemma 4B outperforms the base Gemma 3 4B model across all tested multimodal
|
217 |
+
health benchmarks.
|
218 |
+
|
219 |
+
| Task and metric | MedGemma 4B | Gemma 3 4B |
|
220 |
+
| :---- | :---- | :---- |
|
221 |
+
| **Medical image classification** | | |
|
222 |
+
| MIMIC CXR \- Average F1 for top 5 conditions | 88.9 | 81.1 |
|
223 |
+
| CheXpert CXR \- Average F1 for top 5 conditions | 48.1 | 31.2 |
|
224 |
+
| DermMCQA\* \- Accuracy | 71.8 | 42.6 |
|
225 |
+
| **Visual question answering** | | |
|
226 |
+
| SlakeVQA (radiology) \- Tokenized F1 | 62.3 | 38.6 |
|
227 |
+
| VQA-Rad\*\* (radiology) \- Tokenized F1 | 49.9 | 38.6 |
|
228 |
+
| PathMCQA (histopathology, internal\*\*\*) \- Accuracy | 69.8 | 37.1 |
|
229 |
+
| **Knowledge and reasoning** | | |
|
230 |
+
| MedXpertQA (text \+ multimodal questions) \- Accuracy | 18.8 | 16.4 |
|
231 |
+
*Described in [Liu (2020, Nature
|
232 |
+
medicine)](https://www.nature.com/articles/s41591-020-0842-3), presented as a
|
233 |
+
4-way MCQ per example for skin condition classification.
|
234 |
+
|
235 |
+
**Based on "balanced split," described in [Yang (2024,
|
236 |
+
arXiv)](https://arxiv.org/pdf/2405.03162).
|
237 |
+
***Based on multiple datasets, presented as 3-9 way MCQ per example for
|
238 |
+
identification, grading, and subtype for breast, cervical, and prostate cancer.
|
239 |
+
#### Chest X-ray report generation
|
240 |
+
MedGemma chest X-ray (CXR) report generation performance was evaluated on
|
241 |
+
[MIMIC-CXR](https://physionet.org/content/mimic-cxr/2.1.0/) using the [RadGraph
|
242 |
+
F1 metric](https://arxiv.org/abs/2106.14463). We compare the MedGemma
|
243 |
+
pre-trained checkpoint with our previous best model for CXR report generation,
|
244 |
+
[PaliGemma 2](https://arxiv.org/abs/2412.03555).
|
245 |
+
| Metric | MedGemma 4B (pre-trained) | PaliGemma 2 3B (tuned for CXR) | PaliGemma 2 10B (tuned for CXR) |
|
246 |
+
| :---- | :---- | :---- | :---- |
|
247 |
+
| **Chest X-ray report generation** | | | |
|
248 |
+
| MIMIC CXR \- RadGraph F1 | 29.5 | 28.8 | 29.5 |
|
249 |
+
The instruction-tuned versions of MedGemma 4B and Gemma 3 4B achieve lower
|
250 |
+
scores (0.22 and 0.12, respectively) due to the differences in reporting style
|
251 |
+
compared to the MIMIC ground truth reports. Further fine-tuning on MIMIC reports
|
252 |
+
will enable users to achieve improved performance.
|
253 |
+
#### Text evaluations
|
254 |
+
MedGemma 4B and text-only MedGemma 27B were evaluated across a range of
|
255 |
+
text-only benchmarks for medical knowledge and reasoning.
|
256 |
+
The MedGemma models outperform their respective base Gemma models across all
|
257 |
+
tested text-only health benchmarks.
|
258 |
+
| Metric | MedGemma 27B | Gemma 3 27B | MedGemma 4B | Gemma 3 4B |
|
259 |
+
| :---- | :---- | :---- | :---- | :---- |
|
260 |
+
| MedQA (4-op) | 89.8 (best-of-5) 87.7 (0-shot) | 74.9 | 64.4 | 50.7 |
|
261 |
+
| MedMCQA | 74.2 | 62.6 | 55.7 | 45.4 |
|
262 |
+
| PubMedQA | 76.8 | 73.4 | 73.4 | 68.4 |
|
263 |
+
| MMLU Med (text only) | 87.0 | 83.3 | 70.0 | 67.2 |
|
264 |
+
| MedXpertQA (text only) | 26.7 | 15.7 | 14.2 | 11.6 |
|
265 |
+
| AfriMed-QA | 84.0 | 72.0 | 52.0 | 48.0 |
|
266 |
+
For all MedGemma 27B results, [test-time
|
267 |
+
scaling](https://arxiv.org/abs/2501.19393) is used to improve performance.
|
268 |
+
### Ethics and safety evaluation
|
269 |
+
#### Evaluation approach
|
270 |
+
Our evaluation methods include structured evaluations and internal red-teaming
|
271 |
+
testing of relevant content policies. Red-teaming was conducted by a number of
|
272 |
+
different teams, each with different goals and human evaluation metrics. These
|
273 |
+
models were evaluated against a number of different categories relevant to
|
274 |
+
ethics and safety, including:
|
275 |
+
* **Child safety**: Evaluation of text-to-text and image-to-text prompts
|
276 |
+
covering child safety policies, including child sexual abuse and
|
277 |
+
exploitation.
|
278 |
+
* **Content safety:** Evaluation of text-to-text and image-to-text prompts
|
279 |
+
covering safety policies, including harassment, violence and gore, and hate
|
280 |
+
speech.
|
281 |
+
* **Representational harms**: Evaluation of text-to-text and image-to-text
|
282 |
+
prompts covering safety policies, including bias, stereotyping, and harmful
|
283 |
+
associations or inaccuracies.
|
284 |
+
* **General medical harms:** Evaluation of text-to-text and image-to-text
|
285 |
+
prompts covering safety policies, including information quality and harmful
|
286 |
+
associations or inaccuracies.
|
287 |
+
In addition to development level evaluations, we conduct "assurance evaluations"
|
288 |
+
which are our "arms-length" internal evaluations for responsibility governance
|
289 |
+
decision making. They are conducted separately from the model development team,
|
290 |
+
to inform decision making about release. High-level findings are fed back to the
|
291 |
+
model team, but prompt sets are held out to prevent overfitting and preserve the
|
292 |
+
results' ability to inform decision making. Notable assurance evaluation results
|
293 |
+
are reported to our Responsibility & Safety Council as part of release review.
|
294 |
+
|
295 |
+
#### Evaluation results
|
296 |
+
|
297 |
+
For all areas of safety testing, we saw safe levels of performance across the
|
298 |
+
categories of child safety, content safety, and representational harms. All
|
299 |
+
testing was conducted without safety filters to evaluate the model capabilities
|
300 |
+
and behaviors. For text-to-text, image-to-text, and audio-to-text, and across
|
301 |
+
both MedGemma model sizes, the model produced minimal policy violations. A
|
302 |
+
limitation of our evaluations was that they included primarily English language
|
303 |
+
prompts.
|
304 |
+
|
305 |
+
## Data card
|
306 |
+
|
307 |
+
### Dataset overview
|
308 |
+
|
309 |
+
#### Training
|
310 |
+
|
311 |
+
The base Gemma models are pre-trained on a large corpus of text and code data.
|
312 |
+
MedGemma 4B utilizes a [SigLIP](https://arxiv.org/abs/2303.15343) image encoder
|
313 |
+
that has been specifically pre-trained on a variety of de-identified medical
|
314 |
+
data, including radiology images, histopathology images, ophthalmology images,
|
315 |
+
and dermatology images. Its LLM component is trained on a diverse set of medical
|
316 |
+
data, including medical text relevant to radiology images, chest-x rays,
|
317 |
+
histopathology patches, ophthalmology images and dermatology images.
|
318 |
+
|
319 |
+
#### Evaluation
|
320 |
+
|
321 |
+
MedGemma models have been evaluated on a comprehensive set of clinically
|
322 |
+
relevant benchmarks, including over 22 datasets across 5 different tasks and 6
|
323 |
+
medical image modalities. These include both open benchmark datasets and curated
|
324 |
+
datasets, with a focus on expert human evaluations for tasks like CXR report
|
325 |
+
generation and radiology VQA.
|
326 |
+
|
327 |
+
#### Source
|
328 |
+
|
329 |
+
MedGemma utilizes a combination of public and private datasets.
|
330 |
+
|
331 |
+
This model was trained on diverse public datasets including MIMIC-CXR (chest
|
332 |
+
X-rays and reports), Slake-VQA (multimodal medical images and questions),
|
333 |
+
PAD-UFES-20 (skin lesion images and data), SCIN (dermatology images), TCGA
|
334 |
+
(cancer genomics data), CAMELYON (lymph node histopathology images), PMC-OA
|
335 |
+
(biomedical literature with images), and Mendeley Digital Knee X-Ray (knee
|
336 |
+
X-rays).
|
337 |
+
|
338 |
+
Additionally, multiple diverse proprietary datasets were licensed and
|
339 |
+
incorporated (described next).
|
340 |
+
|
341 |
+
### Data Ownership and Documentation
|
342 |
+
|
343 |
+
* [Mimic-CXR](https://physionet.org/content/mimic-cxr/2.1.0/): MIT Laboratory
|
344 |
+
for Computational Physiology and Beth Israel Deaconess Medical Center
|
345 |
+
(BIDMC).
|
346 |
+
* [Slake-VQA](https://www.med-vqa.com/slake/): The Hong Kong Polytechnic
|
347 |
+
University (PolyU), with collaborators including West China Hospital of
|
348 |
+
Sichuan University and Sichuan Academy of Medical Sciences / Sichuan
|
349 |
+
Provincial People's Hospital.
|
350 |
+
* [PAD-UFES-20](https://pmc.ncbi.nlm.nih.gov/articles/PMC7479321/): Federal
|
351 |
+
University of Espírito Santo (UFES), Brazil, through its Dermatological and
|
352 |
+
Surgical Assistance Program (PAD).
|
353 |
+
* [SCIN](https://github.com/google-research-datasets/scin): A collaboration
|
354 |
+
between Google Health and Stanford Medicine.
|
355 |
+
* [TCGA](https://portal.gdc.cancer.gov/) (The Cancer Genome Atlas): A joint
|
356 |
+
effort of National Cancer Institute and National Human Genome Research
|
357 |
+
Institute. Data from TCGA are available via the Genomic Data Commons (GDC)
|
358 |
+
* [CAMELYON](https://camelyon17.grand-challenge.org/Data/): The data was
|
359 |
+
collected from Radboud University Medical Center and University Medical
|
360 |
+
Center Utrecht in the Netherlands.
|
361 |
+
* [PMC-OA (PubMed Central Open Access
|
362 |
+
Subset)](https://catalog.data.gov/dataset/pubmed-central-open-access-subset-pmc-oa):
|
363 |
+
Maintained by the National Library of Medicine (NLM) and National Center for
|
364 |
+
Biotechnology Information (NCBI), which are part of the NIH.
|
365 |
+
* [MedQA](https://arxiv.org/pdf/2009.13081): This dataset was created by a
|
366 |
+
team of researchers led by Di Jin, Eileen Pan, Nassim Oufattole, Wei-Hung
|
367 |
+
Weng, Hanyi Fang, and Peter Szolovits
|
368 |
+
* [Mendeley Digital Knee
|
369 |
+
X-Ray](https://data.mendeley.com/datasets/t9ndx37v5h/1): This dataset is
|
370 |
+
from Rani Channamma University, and is hosted on Mendeley Data.
|
371 |
+
* [AfriMed-QA](https://afrimedqa.com/): This data was developed and led by
|
372 |
+
multiple collaborating organizations and researchers include key
|
373 |
+
contributors: Intron Health, SisonkeBiotik, BioRAMP, Georgia Institute of
|
374 |
+
Technology, and MasakhaneNLP.
|
375 |
+
* [VQA-RAD](https://www.nature.com/articles/sdata2018251): This dataset was
|
376 |
+
created by a research team led by Jason J. Lau, Soumya Gayen, Asma Ben
|
377 |
+
Abacha, and Dina Demner-Fushman and their affiliated institutions (the US
|
378 |
+
National Library of Medicine and National Institutes of Health)
|
379 |
+
* [MedExpQA](https://www.sciencedirect.com/science/article/pii/S0933365724001805):
|
380 |
+
This dataset was created by researchers at the HiTZ Center (Basque Center
|
381 |
+
for Language Technology and Artificial Intelligence).
|
382 |
+
* [MedXpertQA](https://huggingface.co/datasets/TsinghuaC3I/MedXpertQA): This
|
383 |
+
dataset was developed by researchers at Tsinghua University (Beijing, China)
|
384 |
+
and Shanghai Artificial Intelligence Laboratory (Shanghai, China).
|
385 |
+
In addition to the public datasets listed above, MedGemma was also trained on
|
386 |
+
de-identified datasets licensed for research or collected internally at Google
|
387 |
+
from consented participants.
|
388 |
+
|
389 |
+
* Radiology dataset 1: De-identified dataset of different CT studies across
|
390 |
+
body parts from a US-based radiology outpatient diagnostic center network.
|
391 |
+
* Ophthalmology dataset 1: De-identified dataset of fundus images from
|
392 |
+
diabetic retinopathy screening.
|
393 |
+
* Dermatology dataset 1: De-identified dataset of teledermatology skin
|
394 |
+
condition images (both clinical and dermatoscopic) from Colombia.
|
395 |
+
* Dermatology dataset 2: De-identified dataset of skin cancer images (both
|
396 |
+
clinical and dermatoscopic) from Australia.
|
397 |
+
* Dermatology dataset 3: De-identified dataset of non-diseased skin images
|
398 |
+
from an internal data collection effort.
|
399 |
+
* Pathology dataset 1: De-identified dataset of histopathology H&E whole slide
|
400 |
+
images created in collaboration with an academic research hospital and
|
401 |
+
biobank in Europe. Comprises de-identified colon, prostate, and lymph nodes.
|
402 |
+
* Pathology dataset 2: De-identified dataset of lung histopathology H&E and
|
403 |
+
IHC whole slide images created by a commercial biobank in the United States.
|
404 |
+
* Pathology dataset 3: De-identified dataset of prostate and lymph node H&E
|
405 |
+
and IHC histopathology whole slide images created by a contract research
|
406 |
+
organization in the United States.
|
407 |
+
* Pathology dataset 4: De-identified dataset of histopathology, predominantly
|
408 |
+
H\&E whole slide images created in collaboration with a large, tertiary
|
409 |
+
teaching hospital in the United States. Comprises a diverse set of tissue
|
410 |
+
and stain types, predominantly H&E.
|
411 |
+
### Data citation
|
412 |
+
|
413 |
+
* **MIMIC-CXR** Johnson, A., Pollard, T., Mark, R., Berkowitz, S., & Horng, S.
|
414 |
+
(2024). MIMIC-CXR Database (version 2.1.0). PhysioNet.
|
415 |
+
https://physionet.org/content/mimic-cxr/2.1.0/
|
416 |
+
*and* Johnson, Alistair E. W., Tom J. Pollard, Seth J. Berkowitz, Nathaniel R.
|
417 |
+
Greenbaum, Matthew P. Lungren, Chih-Ying Deng, Roger G. Mark, and Steven
|
418 |
+
Horng. 2019. "MIMIC-CXR, a de-Identified Publicly Available Database of
|
419 |
+
Chest Radiographs with Free-Text Reports." *Scientific Data 6* (1): 1–8.
|
420 |
+
* **SLAKE** Liu, Bo, Li-Ming Zhan, Li Xu, Lin Ma, Yan Yang, and Xiao-Ming Wu.
|
421 |
+
2021.SLAKE: A Semantically-Labeled Knowledge-Enhanced Dataset for Medical
|
422 |
+
Visual Question Answering." http://arxiv.org/abs/2102.09542.
|
423 |
+
* **PAD-UEFS** Pacheco, A. G. C., Lima, G. R., Salomao, A., Krohling, B.,
|
424 |
+
Biral, I. P., de Angelo, G. G., Alves, F. O. G., Ju X. M., & P. R. C.
|
425 |
+
(2020). PAD-UFES-20: A skin lesion dataset composed of patient data and
|
426 |
+
clinical images collected from smartphones. In *Proceedings of the 2020 IEEE
|
427 |
+
International Conference on Bioinformatics and Biomedicine (BIBM)* (pp.
|
428 |
+
1551-1558). IEEE. https://doi.org/10.1109/BIBM49941.2020.9313241
|
429 |
+
* **SCIN** Ward, Abbi, Jimmy Li, Julie Wang, Sriram Lakshminarasimhan, Ashley
|
430 |
+
Carrick, Bilson Campana, Jay Hartford, et al. 2024. "Creating an Empirical
|
431 |
+
Dermatology Dataset Through Crowdsourcing With Web Search Advertisements."
|
432 |
+
*JAMA Network Open 7* (11): e2446615–e2446615.
|
433 |
+
* **TCGA** The results shown here are in whole or part based upon data
|
434 |
+
generated by the TCGA Research Network: https://www.cancer.gov/tcga.
|
435 |
+
* **CAMELYON16** Ehteshami Bejnordi, Babak, Mitko Veta, Paul Johannes van
|
436 |
+
Diest, Bram van Ginneken, Nico Karssemeijer, Geert Litjens, Jeroen A. W. M.
|
437 |
+
van der Laak, et al. 2017. "Diagnostic Assessment of Deep Learning
|
438 |
+
Algorithms for Detection of Lymph Node Metastases in Women With Breast
|
439 |
+
Cancer." *JAMA 318* (22): 2199–2210.
|
440 |
+
* **MedQA** Jin, Di, Eileen Pan, Nassim Oufattole, Wei-Hung Weng, Hanyi Fang,
|
441 |
+
and Peter Szolovits. 2020. "What Disease Does This Patient Have? A
|
442 |
+
Large-Scale Open Domain Question Answering Dataset from Medical Exams."
|
443 |
+
http://arxiv.org/abs/2009.13081.
|
444 |
+
* **Mendeley Digital Knee X-Ray** Gornale, Shivanand; Patravali, Pooja (2020),
|
445 |
+
"Digital Knee X-ray Images", Mendeley Data, V1, doi: 10.17632/t9ndx37v5h.1
|
446 |
+
* **AfrimedQA** Olatunji, Tobi, Charles Nimo, Abraham Owodunni, Tassallah
|
447 |
+
Abdullahi, Emmanuel Ayodele, Mardhiyah Sanni, Chinemelu Aka, et al. 2024.
|
448 |
+
"AfriMed-QA: A Pan-African, Multi-Specialty, Medical Question-Answering
|
449 |
+
Benchmark Dataset." http://arxiv.org/abs/2411.15640.
|
450 |
+
* **VQA-RAD** Lau, Jason J., Soumya Gayen, Asma Ben Abacha, and Dina
|
451 |
+
Demner-Fushman. 2018. "A Dataset of Clinically Generated Visual Questions
|
452 |
+
and Answers about Radiology Images." *Scientific Data 5* (1): 1–10.
|
453 |
+
* **MedexpQA** Alonso, I., Oronoz, M., & Agerri, R. (2024). MedExpQA:
|
454 |
+
Multilingual Benchmarking of Large Language Models for Medical Question
|
455 |
+
Answering. *arXiv preprint arXiv:2404.05590*. Retrieved from
|
456 |
+
https://arxiv.org/abs/2404.05590
|
457 |
+
* **MedXpertQA** Zuo, Yuxin, Shang Qu, Yifei Li, Zhangren Chen, Xuekai Zhu,
|
458 |
+
Ermo Hua, Kaiyan Zhang, Ning Ding, and Bowen Zhou. 2025. "MedXpertQA:
|
459 |
+
Benchmarking Expert-Level Medical Reasoning and Understanding."
|
460 |
+
http://arxiv.org/abs/2501.18362.
|
461 |
+
### De-identification/anonymization:
|
462 |
+
|
463 |
+
Google and partnerships utilize datasets that have been rigorously anonymized or
|
464 |
+
de-identified to ensure the protection of individual research participants and
|
465 |
+
patient privacy
|
466 |
+
|
467 |
+
## Implementation information
|
468 |
+
|
469 |
+
Details about the model internals.
|
470 |
+
|
471 |
+
### Software
|
472 |
+
|
473 |
+
Training was done using [JAX](https://github.com/jax-ml/jax).
|
474 |
+
|
475 |
+
JAX allows researchers to take advantage of the latest generation of hardware,
|
476 |
+
including TPUs, for faster and more efficient training of large models.
|
477 |
+
|
478 |
+
## Use and limitations
|
479 |
+
|
480 |
+
### Intended use
|
481 |
+
|
482 |
+
MedGemma is an open multimodal generative AI model intended to be used as a
|
483 |
+
starting point that enables more efficient development of downstream healthcare
|
484 |
+
applications involving medical text and images. MedGemma is intended for
|
485 |
+
developers in the life sciences and healthcare space. Developers are responsible
|
486 |
+
for training, adapting and making meaningful changes to MedGemma to accomplish
|
487 |
+
their specific intended use. MedGemma models can be fine-tuned by developers
|
488 |
+
using their own proprietary data for their specific tasks or solutions.
|
489 |
+
|
490 |
+
MedGemma is based on Gemma 3 and has been further trained on medical images and
|
491 |
+
text. MedGemma enables further development in any medical context (image and
|
492 |
+
textual), however the model was pre-trained using chest X-ray, pathology,
|
493 |
+
dermatology, and fundus images. Examples of tasks within MedGemma's training
|
494 |
+
include visual question answering pertaining to medical images, such as
|
495 |
+
radiographs, or providing answers to textual medical questions. Full details of
|
496 |
+
all the tasks MedGemma has been evaluated can be found in an upcoming technical
|
497 |
+
report.
|
498 |
+
|
499 |
+
### Benefits
|
500 |
+
|
501 |
+
* Provides strong baseline medical image and text comprehension for models of
|
502 |
+
its size.
|
503 |
+
* This strong performance makes it efficient to adapt for downstream
|
504 |
+
healthcare-based use cases, compared to models of similar size without
|
505 |
+
medical data pre-training.
|
506 |
+
* This adaptation may involve prompt engineering, grounding, agentic
|
507 |
+
orchestration or fine-tuning depending on the use case, baseline validation
|
508 |
+
requirements, and desired performance characteristics.
|
509 |
+
### Limitations
|
510 |
+
|
511 |
+
MedGemma is not intended to be used without appropriate validation, adaptation
|
512 |
+
and/or making meaningful modification by developers for their specific use case.
|
513 |
+
The outputs generated by MedGemma are not intended to directly inform clinical
|
514 |
+
diagnosis, patient management decisions, treatment recommendations, or any other
|
515 |
+
direct clinical practice applications. Performance benchmarks highlight baseline
|
516 |
+
capabilities on relevant benchmarks, but even for image and text domains that
|
517 |
+
constitute a substantial portion of training data, inaccurate model output is
|
518 |
+
possible. All outputs from MedGemma should be considered preliminary and require
|
519 |
+
independent verification, clinical correlation, and further investigation
|
520 |
+
through established research and development methodologies.
|
521 |
+
|
522 |
+
MedGemma's multimodal capabilities have been primarily evaluated on single-image
|
523 |
+
tasks. MedGemma has not been evaluated in use cases that involve comprehension
|
524 |
+
of multiple images.
|
525 |
+
|
526 |
+
MedGemma has not been evaluated or optimized for multi-turn applications.
|
527 |
+
|
528 |
+
MedGemma's training may make it more sensitive to the specific prompt used than
|
529 |
+
Gemma 3.
|
530 |
+
|
531 |
+
When adapting MedGemma developer should consider the following:
|
532 |
+
|
533 |
+
* **Bias in validation data:** As with any research, developers should ensure
|
534 |
+
that any downstream application is validated to understand performance using
|
535 |
+
data that is appropriately representative of the intended use setting for
|
536 |
+
the specific application (e.g., age, sex, gender, condition, imaging device,
|
537 |
+
etc).
|
538 |
+
* **Data contamination concerns**: When evaluating the generalization
|
539 |
+
capabilities of a large model like MedGemma in a medical context, there is a
|
540 |
+
risk of data contamination, where the model might have inadvertently seen
|
541 |
+
related medical information during its pre-training, potentially
|
542 |
+
overestimating its true ability to generalize to novel medical concepts.
|
543 |
+
Developers should validate MedGemma on datasets not publicly available or
|
544 |
+
otherwise made available to non-institutional researchers to mitigate this
|
545 |
+
risk.
|
RKllm.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
medgemma-4b-pt.rkllm
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:513dffee7361fff79f0bf3f173ec6e9124c3964e90371accd51dd3b6252329bd
|
3 |
+
size 9134815230
|