Run this model with HF Jobs
Run google/medgemma-2-26B-A4B-it on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/google/medgemma-2-26B-A4B-it. Ask me which dataset to train on, then push the fine-tuned model to a new private model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/google/medgemma-2-26B-A4B-it on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/google/medgemma-2-26B-A4B-it. Ask me which benchmark to run, then save the scores and the per-example results to a new private dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/google/medgemma-2-26B-A4B-it. Push it to a new private model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use google/medgemma-2-26B-A4B-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/medgemma-2-26B-A4B-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="google/medgemma-2-26B-A4B-it") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("google/medgemma-2-26B-A4B-it") model = AutoModelForMultimodalLM.from_pretrained("google/medgemma-2-26B-A4B-it", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use google/medgemma-2-26B-A4B-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "google/medgemma-2-26B-A4B-it" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/medgemma-2-26B-A4B-it", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/google/medgemma-2-26B-A4B-it
- SGLang
How to use google/medgemma-2-26B-A4B-it with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "google/medgemma-2-26B-A4B-it" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/medgemma-2-26B-A4B-it", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "google/medgemma-2-26B-A4B-it" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/medgemma-2-26B-A4B-it", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use google/medgemma-2-26B-A4B-it with Docker Model Runner:
docker model run hf.co/google/medgemma-2-26B-A4B-it
Model Garden |
Hugging Face |
GitHub |
Launch Blog |
Research Blog |
Documentation
License: HAI-DEF Terms of Use | Authors: Google | Support
This card describes MedGemma 2, available as a 4B multimodal instruction-tuned variant (E4B) and a 26B Mixture-of-Experts instruction-tuned variant (A4B). For information on earlier variants, refer to the MedGemma 1.5 model card and the MedGemma 1 model card.
MedGemma is a collection of Gemma variants that are trained for performance on medical text and image comprehension. Developers can use MedGemma to accelerate building healthcare-based AI applications.
MedGemma 2 is an update to the MedGemma collection built on the Gemma 4 architecture, with no modifications to the Gemma 4 base architecture. Driven by developer and clinical research feedback, MedGemma 2 moves MedGemma from passive multimodal question answering to reasoning-capable models built for real-world clinical workflows across both server-scale and resource-constrained edge deployments. MedGemma 2 is released as two instruction-tuned checkpoints:
- MedGemma 2 4B (E4B): A compact multimodal model (effective 4B parameters) designed for edge, mobile, and local developer deployments, supporting a context window of up to 128K tokens.
- MedGemma 2 26B MoE (A4B): A 26B Mixture-of-Experts model (approximately 4B active parameters per token) designed for hospital on-premises servers and private cloud deployments, supporting a context window of up to 256K tokens.
Model Overview
The MedGemma 2 models are built on Gemma 4 and use the same decoder-only transformer architecture as Gemma 4, with no base architectural modifications. The 4B variant follows the Gemma 4 E4B dense design; the 26B variant follows the Gemma 4 26B Mixture-of-Experts (A4B) design. To learn more about the architecture, consult the Gemma 4 model card.
The LLM component of MedGemma 2 is post-trained, starting from Gemma 4. Post-training uses a diverse set of de-identified and licensed medical data, including medical text, medical question-answer pairs, FHIR-based EHR data, 2D and 3D radiology images, histopathology images, ophthalmology images, dermatology images, medical documents, and (for the 4B model) medical audio. Unlike MedGemma 1 and 1.5 which used a MedSigLIP-derived vision encoder, MedGemma 2 uses the native Gemma 4 vision encoders, without additional medical pre-training of the vision encoder.
- We do not modify the architecture of Gemma 4. Local to global attention ratio is 5-to-1. Position is encoded with p-RoPE with p = 0.25 on global attention layers and with RoPE on local attention layers. The RoPE frequencies are set to 1M and 10k on global and local attention layers, respectively.
MedGemma 2 specifications
| Property | MedGemma 2 4B (E4B) | MedGemma 2 26B MoE (A4B) |
|---|---|---|
| Model type | Decoder-only Transformer architecture, see the Gemma 4 technical report. 4B: dense (E4B). | 26B: Mixture-of-Experts (A4B, ~4B active parameters per token). |
| Total Parameters | ~8B including per-layer embeddings β‘ | 25.2B β‘ |
| Effective / Active Parameters | 4.5B effective β‘ | 3.8B active β‘ |
| Layers | 42 β‘ | 30 β‘ |
| Sliding Window | 512 tokens β‘ | 1,024 tokens β‘ |
| Context Length | Supports long context, validated at 128K tokens for both sizes. | Supports long context, validated at 128K tokens for both sizes. |
| Vocabulary Size | 262K β‘ | 262K β‘ |
| Expert Count | N/A (dense) | 8 active / 128 total and 1 shared β‘ |
| Input modalities | Text, vision (images, volumes, video), and audio. | Text and vision (images, volumes, video). |
| Output modality | Text only | Text only |
| Vision Encoder Parameters | ~150M β‘ | ~550M β‘ |
| Audio Encoder Parameters | ~300M β‘ | N/A |
| Key publication | Sellergren, Andrew, et al. "An open vision-language model for diverse medical applications." Nature Medicine (2026): 1-10. | Sellergren, Andrew, et al. "An open vision-language model for diverse medical applications." Nature Medicine (2026): 1-10. |
| Model version | 2.0.0 | 2.0.0 |
β‘ Based on Gemma 4
Benchmark Results
MedGemma 2 was evaluated across a range of different multimodal classification, agentic tool use, grounding, long-context EHR, and text-based tasks.
MedGemma 2 has been evaluated on a range of clinically relevant benchmarks to illustrate its baseline performance. These evaluations are based on both open benchmark datasets and internally curated datasets. Developers are expected to fine-tune MedGemma for improved performance on their use case. Consult the Intended use section for more details.
Sampling settings used for these evaluations are listed under Best Practices.
Imaging evaluations
The multimodal performance of MedGemma 2 4B and 26B MoE was evaluated across benchmarks covering radiology (2D, longitudinal 2D, and anatomical localization), histopathology, and dermatology. Results for MedGemma 1.5 4B, Gemma 4 E4B, and Gemma 4 26B are shown for comparison; see the Data card for dataset details.
| Task / Dataset | Metric | MedGemma 2 4B | MedGemma 1.5 4B | Gemma 4 E4B | MedGemma 2 26B MoE | Gemma 4 26B |
|---|---|---|---|---|---|---|
| 2D image classification | ||||||
| MIMIC-CXR** | Macro F1 (top 5 conditions) | 86.3 | 89.5 | 74.2 | 89.8 | 84.9 |
| CheXpert CXR | Macro F1 (top 5 conditions) | 48.8 | 48.2 | 34.9 | 51.2 | 49.3 |
| PathMCQA* (histopathology) | Accuracy | 63.3 | 70.0 | 42.7 | 68.0 | 49.6 |
| US-DermMCQA* | Accuracy | 68.5 | 73.5 | 62.0 | 77.2 | 70.2 |
| Disease progression classification (longitudinal) | ||||||
| MS-CXR-T | Macro accuracy | 65.1 | 65.7 | 62.1 | 65.7 | 63.0 |
| Region of interest detection | ||||||
| Chest ImaGenome: Anatomy bounding box detection | Intersection over union | 53.7 | 38.0 | 21.5 | 54.2 | 34.1 |
* Internal datasets. US-DermMCQA is described in Liu et al. (2020, Nature medicine), presented as a 4-way MCQ per example for skin condition classification. PathMCQA is based on multiple datasets, presented as 3-9 way MCQ per example for identification, grading, and subtype for breast, cervical, and prostate cancer. A subset of these datasets are described in more detail in the MedGemma 1.5 Technical Report.
** Based on radiologist adjudicated labels, described in Yang (2024, arXiv) Section A.1.1.
Text evaluations (optimized for 4B)
MedGemma 2 4B was evaluated across text-only benchmarks for medical knowledge and clinical reasoning, with MedGemma 1.5 4B and Gemma 4 E4B shown for comparison.
| Task / Dataset | Metric | MedGemma 2 4B | MedGemma 1.5 4B | Gemma 4 E4B |
|---|---|---|---|---|
| Medical knowledge and reasoning | ||||
| MedQA (4-op) | Accuracy | 82.3 | 69.1 | 74.0 |
| MedMCQA | Accuracy | 63.8 | 59.8 | 62.6 |
| PubMedQA | Accuracy | 78.6 | 67.6 | 73.0 |
| MMLU Med | Macro accuracy | 81.6 | 69.6 | 79.0 |
| AfriMed-QA | Accuracy | 68.3 | β | 66.9 |
| MedCaseReasoning | Accuracy | 23.2 | β | 20.7 |
| MedCase (MCQA) | Accuracy | 44.6 | β | 38.7 |
Agentic tool use evaluations
Agentic tool use and code generation were evaluated across multi-step FHIR and SQL EHR retrieval, clinical information seeking, and Python-based medical calculations against Gemma 4 E4B and Gemma 4 26B (MedGemma 1.5 4B does not support native tool calling).
| Task / Dataset | Metric | MedGemma 2 4B | Gemma 4 E4B | MedGemma 2 26B MoE | Gemma 4 26B |
|---|---|---|---|---|---|
| MedAgentBench | Success rate | 53.3 | 48.7 | 86.3 | 81.3 |
| AgentEHR (common) | F1 | 27.7 | 10.2 | 30.7 | 23.5 |
| AgentEHR (rare) | F1 | 23.3 | 7.1 | 26.5 | 22.5 |
| ClinSeek-Bench* | F1 | 44.0 | 33.5 | 49.1 | 47.2 |
| MedCalc-Bench Verified | Accuracy | 59.1 | 37.9 | 72.8 | 66.2 |
* Evaluated with no web search used.
Grounding evaluations
Source-grounded question answering and faithfulness to supplied reference material were evaluated on an internal clinical grounding benchmark, with MedGemma 1.5 4B, Gemma 4 E4B, and Gemma 4 26B shown for comparison.
| Task / Dataset | Metric | MedGemma 2 4B | MedGemma 1.5 4B | Gemma 4 E4B | MedGemma 2 26B MoE | Gemma 4 26B |
|---|---|---|---|---|---|---|
| Grounded Clinical QA* | Accuracy | 94.8 | 13.1 | 85.2 | 95.6 | 90.8 |
* Internal dataset.
Medical record evaluations
EHR comprehension and clinical summarization were evaluated on synthetic longitudinal text and FHIR records, de-identified clinical notes, and hospital course and discharge summaries, with MedGemma 1.5 4B, Gemma 4 E4B, and Gemma 4 26B shown for comparison.
| Task / Dataset | Metric | MedGemma 2 4B | MedGemma 1.5 4B | Gemma 4 E4B | MedGemma 2 26B MoE | Gemma 4 26B |
|---|---|---|---|---|---|---|
| EHR question answering | ||||||
| EHRQA* (text) | Accuracy | 97.4 | 89.6 | 97.1 | 97.7 | 97.0 |
| EHRQA* (FHIR) | Accuracy | 95.6 | 58.0 | 94.6 | 95.2 | 94.7 |
| EHRNoteQA | Accuracy | 93.7 | 80.4 | 92.1 | 95.0 | 94.3 |
| Clinical summarization | ||||||
| DischargeMe** (course summary) | Composite score (0β10) | 7.08 | 5.93 | 7.09 | 7.29 | 7.31 |
| DischargeMe** (discharge summary) | Composite score (0β10) | 7.35 | 4.59 | 7.26 | 7.58 | 7.49 |
* Internal dataset.
** Evaluated on 2,000 test examples using an equal-weighted mean of three LLM-judge scores (factuality, grounding, clarity) and length similarity; not directly comparable to the BioNLP 2024 shared-task composite. This rubric is used instead of n-gram overlap (e.g., ROUGE/BLEU) to better capture factual completeness, valid paraphrasing, and hallucinations relative to the source record.
Document understanding evaluations (optimized for 4B)
Structured extraction from unstructured medical PDF documents (clinical laboratory reports and prescriptions) into JSON was evaluated across internal benchmarks, with MedGemma 1.5 4B and Gemma 4 E4B shown for comparison.
| Task / Dataset | Metric | MedGemma 2 4B | MedGemma 1.5 4B | Gemma 4 E4B |
|---|---|---|---|---|
| PDF-to-JSON structured extraction | ||||
| EHR Dataset 2* (raw PDF lab reports to JSON) | Macro F1 | 94.0 | 91.0 | 93.4 |
| Micro F1 | 92.6 | 88.0 | 92.5 | |
| EHR Dataset 3* (raw PDF lab reports to JSON) | Macro F1 | 85.0 | 71.0 | 78.6 |
| Micro F1 | 85.9 | 70.0 | 78.7 | |
| Prescription Dataset 1* (prescriptions to JSON) | Macro F1 | 83.3 | β | 83.3 |
| Micro F1 | 83.8 | β | 83.7 |
* Internal datasets.
Medical audio evaluations (available in 4B only)
Medical speech transcription for MedGemma 2 4B (the only MedGemma 2 variant with audio input support) was evaluated on de-identified medical dictation, with Gemma 4 E4B and MedASR shown for comparison. Audio evaluations are benchmarked using the Massive Sound Evaluation Benchmark (MSEB) framework.
| Task / Dataset | Metric | MedGemma 2 4B | Gemma 4 E4B | MedASR |
|---|---|---|---|---|
| Medical dictation transcription | ||||
| Audio Dataset 1* (radiology dictation) | WER (%) β | 10.6 | 27.2 | 5.4 |
| Audio Dataset 1* (family medicine dictation) | WER (%) β | 11.9 | 28.4 | 7.3 |
| Audio Dataset 1* (general and internal medicine dictation) | WER (%) β | 15.9 | 29.5 | 9.5 |
| Audio Dataset 1* (internal medicine dictation) | WER (%) β | 17.6 | 43.2 | 10.2 |
| Eye Gaze (chest X-ray dictation) | WER (%) β | 7.3 | 24.2 | 5.2 |
* Internal dataset.
Core Capabilities
MedGemma 2 adds or improves support for:
- Native tool calling and clinical reasoning: Purposeful chain-of-thought reasoning and native tool calling, including generating structured HL7 FHIR API queries, SQL queries, and Python code for external execution for clinical calculations. These features enable multi-application workflows that can help developers assemble a unified patient view across fragmented clinical systems. Developers remain solely responsible for hosting, sandboxing, and validating all code execution and database queries within their own secure environments.
- Clinical grounding: Provide answers with grounded references to supplied contextual material, such as clinical guidelines and biomedical literature (retrieval-augmented generation).
- Native medical audio understanding and dictation transcription (4B only): Transcribes developer-provided medical audio directly within the 4B model through a fine-tuned Gemma 4 audio encoder. This can help simplify workflows that would otherwise need a separate speech-to-text step. The model processes supplied audio only; it does not include live audio recording, streaming microphone capture, or ambient listening. Developers integrating audio features must ensure independent compliance with patient notice, recording consent, and applicable privacy laws.
- Long-context EHR and document understanding: Longitudinal Electronic Health Record (EHR) comprehension validated across 128K-token context windows and medical document understanding.
In addition to these new capabilities, MedGemma 2 delivers improved accuracy on medical text and multimodal reasoning compared to MedGemma 1.5. MedGemma 1.5 remains available for developers focused on certain medical image classification.
For medical image-based applications that do not involve text generation, such as data-efficient classification, zero-shot classification, or content-based or semantic image retrieval, the MedSigLIP image encoder is recommended.
Best Practices
For the best performance, use these configurations and best practices:
1. Sampling settings
For generation, we recommend Gemma 4 default sampling parameters (temperature=1.0, top_p=0.95, top_k=64), which were also used across MedGemma 2 benchmark evaluations.
2. Thinking Mode Configuration
- Trigger Thinking: Thinking is enabled by including the
<|think|>token at the start of the system prompt, and disabled by removing it. In Transformers, setenable_thinking=Trueinapply_chat_template(see How to use). - Standard Generation: When thinking is enabled, the model outputs its internal reasoning as
<|channel>thought\n[Internal reasoning]<channel|>before the final answer.
Note that many libraries like Transformers handle the complexities of the chat template for you.
3. Multi-Turn Conversations
- No Thinking Content in History: Historical model outputs should only include the final response; thoughts from previous model turns must not be added before the next user turn begins, except in tool-calling turns where thinking content is preserved.
4. Modality order
- For optimal performance with multimodal inputs, place image content before the text in your prompt, and audio content after the text.
5. Variable Image Resolution
- Images, variable aspect ratio and resolution with a configurable visual token budget (
max_soft_tokens) of 70, 140, 280 (default), 560, or 1,120 tokens per image. MedGemma 2 single-image 2D training and evaluations used the 1,120-token budget while multi-slice 3D used the 70-token budget (70 or 140 recommended for multi-slice CT/MRI or WSI inference). - Volumetric (CT/MRI) inputs as sequences of frames/slices β Provide ordered 2D cross-sectional slices (with 3-window Hounsfield Unit RGB normalization for CT) using 70 or 140 token per-slice budget for multi-slice studies.
How to use
The following are some example code snippets to help you quickly get started running the model locally on GPU.
If you need to use the model at scale, we recommend using Model Garden, which provides various deployment options and tutorial notebooks.
First, install the Transformers library. Gemma 4 is supported starting from transformers 5.10.1, and transformers 5.15.0 or higher is recommended in order to support prefix-aware response parsing with thinking mode and tool calling.
pip install -U "transformers>=5.15.0" accelerate
Next, use either the pipeline wrapper or the generate API directly to send a chest X-ray image and a question to the model.
Code for MedGemma 2 4B (E4B): Pipeline API and Direct Inference
Run model with the pipeline API
from transformers import pipeline
from PIL import Image
import requests
pipe = pipeline(
"any-to-any",
model="google/medgemma-2-E4B-it",
device_map="auto",
dtype="auto"
)
# Image attribution: Stillwaterising, CC0, via Wikimedia Commons
image_url = "https://storage.googleapis.com/hai-cd3-foundations-public-vault-entry/med_gemma/colab_example/cxr/chest_xray_pa_3-8-2010.png"
image = Image.open(requests.get(image_url, stream=True).raw)
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": "Describe this X-ray"}
]
}
]
output = pipe(text=messages, max_new_tokens=1024)
print(output[0]["generated_text"][-1]["content"])
Run the model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
from PIL import Image
import requests
model_id = "google/medgemma-2-E4B-it"
model = AutoModelForMultimodalLM.from_pretrained(
model_id,
dtype="auto",
device_map="auto"
)
processor = AutoProcessor.from_pretrained(model_id)
# Image attribution: Stillwaterising, CC0, via Wikimedia Commons
image_url = "https://storage.googleapis.com/hai-cd3-foundations-public-vault-entry/med_gemma/colab_example/cxr/chest_xray_pa_3-8-2010.png"
image = Image.open(requests.get(image_url, stream=True).raw)
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": "Describe this X-ray"}
]
}
]
inputs = processor.apply_chat_template(
messages,
tokenize=True,
return_dict=True,
return_tensors="pt",
add_generation_prompt=True,
enable_thinking=False # set to True to enable thinking
).to(model.device)
input_len = inputs["input_ids"].shape[-1]
outputs = model.generate(**inputs, max_new_tokens=1024)
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
# Parse output
parsed_response = processor.parse_response(response, prefix=inputs["input_ids"])
print(parsed_response["content"])
Code for MedGemma 2 26B MoE (A4B): Pipeline API and Direct Inference
Run model with the pipeline API
from transformers import pipeline
from PIL import Image
import requests
pipe = pipeline(
"image-text-to-text",
model="google/medgemma-2-26B-A4B-it",
device_map="auto",
dtype="auto"
)
# Image attribution: Stillwaterising, CC0, via Wikimedia Commons
image_url = "https://storage.googleapis.com/hai-cd3-foundations-public-vault-entry/med_gemma/colab_example/cxr/chest_xray_pa_3-8-2010.png"
image = Image.open(requests.get(image_url, stream=True).raw)
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": "Describe this X-ray"}
]
}
]
output = pipe(text=messages, max_new_tokens=1024)
print(output[0]["generated_text"][-1]["content"])
Run the model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
from PIL import Image
import requests
model_id = "google/medgemma-2-26B-A4B-it"
model = AutoModelForMultimodalLM.from_pretrained(
model_id,
dtype="auto",
device_map="auto"
)
processor = AutoProcessor.from_pretrained(model_id)
# Image attribution: Stillwaterising, CC0, via Wikimedia Commons
image_url = "https://storage.googleapis.com/hai-cd3-foundations-public-vault-entry/med_gemma/colab_example/cxr/chest_xray_pa_3-8-2010.png"
image = Image.open(requests.get(image_url, stream=True).raw)
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": "Describe this X-ray"}
]
}
]
inputs = processor.apply_chat_template(
messages,
tokenize=True,
return_dict=True,
return_tensors="pt",
add_generation_prompt=True,
enable_thinking=False # set to True to enable thinking
).to(model.device)
input_len = inputs["input_ids"].shape[-1]
outputs = model.generate(**inputs, max_new_tokens=1024)
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
# Parse output
parsed_response = processor.parse_response(response, prefix=inputs["input_ids"])
print(parsed_response["content"])
Examples
Refer to the growing collection of tutorial notebooks to see how to use or fine-tune MedGemma.
Inputs and outputs
Input:
- Text string, such as a question or prompt
- Images, volumetric slice sequences, or video frames β variable aspect ratio and resolution, with a configurable visual token budget (
max_soft_tokens) of 70, 140, 280 (default), 560, or 1,120 tokens per image - Audio (4B only) β 16 kHz sampling and 30s max duration
- Total input length of 128K tokens for 4B and up to 256K for 26B
Output:
- Generated text in response to the input, such as an answer to a question, analysis of image content, a summary of a document, a transcription, or a structured tool call
- Total output length of tokens up to 128K tokens, shared with the input context window (subtracting request input tokens). While the underlying Gemma 4 26B A4B architecture supports up to 256K total context, MedGemma 2 checkpoints are validated up to 128K tokens with typical
max_new_tokensgeneration budgets of 1,024-4,096 tokens for standard generation, 8,192-16,384 tokens when thinking mode is enabled, or up to 32k for agentic evaluations.
Model Data
Data used for model training and how the data was processed.
Training Dataset
The base Gemma 4 models are pre-trained on a large corpus of text, code, image, and audio data. MedGemma 2 uses the native Gemma 4 vision encoder. The 4B model also uses the native Gemma 4 audio encoder. Neither encoder received separate medical pre-training. MedGemma 2 was then post-trained on a diverse set of medical data. This data includes medical text, medical question-answer pairs, electronic health record (EHR) and FHIR-based data, medical documents, radiology images (chest X-ray, CT, MRI, ultrasound, and mammography), histopathology images, dermatology images, ophthalmology images, electrocardiograms (ECGs), endoscopy and surgical video, genomics data, and agentic tool-use trajectories. Medical audio data was used to train only the 4B model. Evaluations of model performance on CT, MRI, whole-slide histopathology, genomics, electrocardiogram, endoscopy and surgical video, ultrasound, and mammography inputs are not included in this card.
Evaluation
MedGemma 2 has been evaluated on a comprehensive set of clinically relevant benchmarks across multiple datasets, tasks, and modalities. These benchmarks include both open benchmark datasets and internally curated datasets.
Source
MedGemma 2 uses a combination of public and private datasets.
In addition, multiple diverse proprietary datasets were licensed and incorporated (described next).
Data ownership and documentation
Public datasets
- AfriMed-QA: Developed and led by multiple collaborating organizations and researchers; key contributors include Intron Health, SisonkeBiotik, BioRAMP, Georgia Institute of Technology, and MasakhaneNLP.
- AgentEHR: Created by researchers at Shanghai Jiao Tong University and Shanghai Artificial Intelligence Laboratory.
- BioCoder: Created by researchers at Yale University and Google DeepMind.
- BioDSBench: Created by researchers at the University of Illinois Urbana-Champaign.
- CAMELYON: Collected from Radboud University Medical Center and University Medical Center Utrecht in the Netherlands.
- Cholec80-CVS: Annotations created by researchers at Universidad de los Andes, BogotΓ‘, Colombia, with clinical collaborators at Universidad CES, MedellΓn, on the Cholec80 surgical video dataset from the University of Strasbourg / IHU Strasbourg, France.
- CIViC (Clinical Interpretation of Variants in Cancer): A community knowledgebase developed at Washington University School of Medicine in St. Louis.
- ClinGen (Clinical Genome Resource): An NIH-funded consortium. Its gene-disease validity and variant pathogenicity curations were used.
- ClinSeek-Bench: Created by researchers at the University of California, Santa Cruz and NVIDIA.
- CODE-15%: Telehealth Network of Minas Gerais (TNMG) and Universidade Federal de Minas Gerais (UFMG), Brazil, with collaborators at Uppsala University.
- HEAD-QA: Created by David Vilares and Carlos GΓ³mez-RodrΓguez from the Universidade da CoruΓ±a, Spain, based on exams for the Spanish healthcare specialization system.
- HyperKvasir: Simula Research Laboratory and Bærum Hospital (Vestre Viken Hospital Trust), Norway.
- ISIC: International Skin Imaging Collaboration is a joint effort involving clinicians, researchers, and engineers from various institutions worldwide.
- LiveQA: Created by Asma Ben Abacha, Eugene Agichtein, Yuval Pinter, and Dina Demner-Fushman from the U.S. National Library of Medicine, Emory University, and Georgia Institute of Technology.
- MedAgentGym: Created by researchers at Emory University, Georgia Institute of Technology, and collaborating institutions.
- MedCaseReasoning: Created by researchers at Stanford University from open-access case reports.
- MEDEC: Created by researchers at Microsoft and the University of Washington.
- MedExpQA: Created by researchers at the HiTZ Center (Basque Center for Language Technology and Artificial Intelligence).
- MedMCQA: Created by Ankit Pal, Logesh Kumar Umapathi, and Malaikannan Sankarasubbu from Saama AI Research, Chennai, India.
- MedQA: Created by a team of researchers led by Di Jin, Eileen Pan, Nassim Oufattole, Wei-Hung Weng, Hanyi Fang, and Peter Szolovits.
- MedQuAD: Created by Asma Ben Abacha and Dina Demner-Fushman at the U.S. National Library of Medicine from 12 NIH websites.
- Meissa: Created by researchers at Johns Hopkins University.
- Mendeley Digital Knee X-Ray: From Rani Channamma University, hosted on Mendeley Data.
- MIMIC-CXR: MIT Laboratory for Computational Physiology and Beth Israel Deaconess Medical Center (BIDMC).
- MIMIC-IV-ECG: MIT Laboratory for Computational Physiology and Beth Israel Deaconess Medical Center (BIDMC).
- MIMIC-IV-ECHO: MIT Laboratory for Computational Physiology and Beth Israel Deaconess Medical Center (BIDMC).
- MIMIC-IV-Note: MIT Laboratory for Computational Physiology and Beth Israel Deaconess Medical Center (BIDMC).
- PAD-UFES-20: Federal University of EspΓrito Santo (UFES), Brazil, through its Dermatological and Surgical Assistance Program (PAD).
- PMC-OA (PubMed Central Open Access Subset): Maintained by the National Library of Medicine (NLM) and National Center for Biotechnology Information (NCBI), which are part of the NIH.
- PTB-XL: Physikalisch-Technische Bundesanstalt (PTB), Germany. Hosted on PhysioNet.
- PubMedQA: Created by Qiao Jin, Bhuwan Dhingra, Zhengping Liu, William W. Cohen, and Xinghua Lu from the University of Pittsburgh, Carnegie Mellon University, and Google.
- SCIN: A collaboration between Google Health and Stanford Medicine.
- SIMORD and SYNUR: Created by researchers at Microsoft.
- SLAKE: The Hong Kong Polytechnic University (PolyU), with collaborators including West China Hospital of Sichuan University and Sichuan Academy of Medical Sciences / Sichuan Provincial People's Hospital.
- TCGA (The Cancer Genome Atlas): A joint effort of National Cancer Institute and National Human Genome Research Institute. Data from TCGA are available via the Genomic Data Commons (GDC).
- TCIA B-mode and CEUS Liver: Thomas Jefferson University. Hosted on The Cancer Imaging Archive (TCIA).
- Therapeutics Data Commons: An open initiative led by researchers at Harvard University, with collaborators at Stanford University, MIT, Georgia Institute of Technology, and University of Illinois Urbana-Champaign.
- ToolMind: Created by researchers at Nanbeige Lab (BOSS Zhipin) and Renmin University of China.
- Toucan: Created by researchers at the University of Washington and IBM Research.
- VinDr-Mammo: Vingroup Big Data Institute (VinBigData), Vietnam, in collaboration with Hanoi Medical University Hospital and Hospital 108, Hanoi. Hosted on PhysioNet.
- VQA-RAD: Created by a research team led by Jason J. Lau, Soumya Gayen, Asma Ben Abacha, and Dina Demner-Fushman and their affiliated institutions (the U.S. National Library of Medicine and National Institutes of Health).
In addition to the public datasets listed above, MedGemma 2 was also trained on de-identified, licensed datasets or datasets collected internally at Google from consented participants.
De-identified, licensed, and internal datasets
- Audio dataset 1: De-identified dataset of medical dictations (for example, radiology and family medicine) paired with reference transcripts. Used for the 4B model only.
- Audio dataset 2: De-identified dataset of clinician-patient conversations paired with reference transcripts. Used for the 4B model only.
- CT dataset 1: De-identified dataset of different axial CT studies across body parts (head, chest, abdomen) from a US-based radiology outpatient diagnostic center network.
- Dermatology dataset 1: De-identified dataset of teledermatology skin condition images (both clinical and dermatoscopic) from Colombia.
- Dermatology dataset 2: De-identified dataset of skin cancer images (both clinical and dermatoscopic) from Australia.
- Dermatology dataset 3: De-identified dataset of non-diseased skin images from an internal data collection effort.
- Dermatology dataset 4: De-identified dataset featuring multiple images and longitudinal visits and records from Japan.
- Dermatology dataset 5: Dermatology dataset featuring unlabeled images.
- Dermatology dataset 6: De-identified cases from adult patients with data representing Fitzpatrick 5 or 6 skin types.
- Dermatology dataset 7: De-identified dataset of teledermatology images of skin conditions referred by primary care physicians, with clinical metadata.
- EHR dataset 1: Question/answer dataset drawn from synthetic FHIR records created by Synthea.
- EHR dataset 2: De-identified Lab Reports across different departments in Pathology such as Biochemistry, Clinical Pathology, Hematology, Microbiology and Serology.
- EHR dataset 3: De-identified Lab Reports across different departments in Pathology such as Biochemistry, Clinical Pathology, Hematology, Microbiology and Serology from at least 25 different labs.
- EHR dataset 4: Synthetic dataset of laboratory reports.
- EHR dataset 5: Synthetic dataset of approximately 60,000 health-relevant user queries.
- EHR dataset 6: De-identified dataset of longitudinal clinical records and patient notes with rich metadata.
- EHR dataset 7: De-identified dataset of longitudinal structured clinical records in HL7 FHIR R4 format.
- Mammography dataset 1: De-identified dataset of breast cancer screening mammography with associated multimodal health data from a tertiary hospital in Taiwan.
- MRI dataset 1: De-identified dataset of different axial multi-parametric MRI studies across body parts (head, abdomen, knee) from a US-based radiology outpatient diagnostic center network.
- Ophthalmology dataset 1: De-identified dataset of fundus images from diabetic retinopathy screening.
- Pathology dataset 1: De-identified dataset of histopathology H&E whole slide images created in collaboration with an academic research hospital and biobank in Europe. Comprises de-identified colon, prostate, and lymph nodes.
- Pathology dataset 2: De-identified dataset of lung histopathology H&E and IHC whole slide images created by a commercial biobank in the United States.
- Pathology dataset 3: De-identified dataset of prostate and lymph node H&E and IHC histopathology whole slide images created by a contract research organization in the United States.
- Pathology dataset 4: De-identified dataset of histopathology whole slide images created in collaboration with a large, tertiary teaching hospital in the United States. It comprises a diverse set of tissue and stain types, predominantly H&E.
- Radiology dataset 1: De-identified, large-scale multimodal radiology dataset from a radiology chain in India.
- Radiology dataset 2: De-identified dataset of radiology studies with reports, licensed from a commercial health data provider.
MedGemma 2 was also trained on synthetic datasets generated internally at Google.
Data citation
Dataset citations
- AfriMed-QA: Olatunji, T., Nimo, C., Owodunni, A., Abdullahi, T., Ayodele, E., Sanni, M., Aka, C., et al. (2024). "AfriMed-QA: A Pan-African, Multi-Specialty, Medical Question-Answering Benchmark Dataset." arXiv preprint arXiv:2411.15640. https://arxiv.org/abs/2411.15640
- AgentEHR: Liao, Y., Xuan, C., Cai, Y., Yang, L., Chen, Z., Wang, Y., & Wang, Y. (2026). "AgentEHR: Advancing Autonomous Clinical Decision-Making via Retrospective Summarization." arXiv preprint arXiv:2601.13918. https://arxiv.org/abs/2601.13918
- BioCoder: Tang, X., Qian, B., Gao, R., Chen, J., Chen, X., & Gerstein, M. B. (2024). "BioCoder: a benchmark for bioinformatics code generation with large language models." Bioinformatics 40 (Supplement 1): i266βi276.
- BioDSBench: Wang, Z., Danek, B., Yang, Z., Chen, Z., & Sun, J. (2024). "Can Large Language Models Replace Data Scientists in Biomedical Research?" arXiv preprint arXiv:2410.21591. https://arxiv.org/abs/2410.21591
- CAMELYON16: Ehteshami Bejnordi, B., Veta, M., van Diest, P. J., van Ginneken, B., Karssemeijer, N., Litjens, G., van der Laak, J. A. W. M., et al. (2017). "Diagnostic Assessment of Deep Learning Algorithms for Detection of Lymph Node Metastases in Women With Breast Cancer." JAMA 318 (22): 2199β2210.
- CAMELYON17: Bandi, P., Geessink, O., Manson, Q., Van Dijk, M., Balkenhol, M., Hermsen, M., et al. (2018). "From Detection of Individual Metastases to Classification of Lymph Node Status at the Patient Level: The CAMELYON17 Challenge." IEEE Transactions on Medical Imaging 38 (2): 550β560.
- Cholec80-CVS: RΓos, M. S., Molina-Rodriguez, M. A., LondoΓ±o, D., GuillΓ©n, C. A., Sierra, S., Zapata, F., & Giraldo, L. F. (2023). "Cholec80-CVS: An open dataset with an evaluation of Strasberg's critical view of safety for AI." Scientific Data 10: 194. https://doi.org/10.1038/s41597-023-02073-7 and Twinanda, A. P., Shehata, S., Mutter, D., Marescaux, J., de Mathelin, M., & Padoy, N. (2017). "EndoNet: A Deep Architecture for Recognition Tasks on Laparoscopic Videos." IEEE Transactions on Medical Imaging 36 (1): 86β97. https://doi.org/10.1109/TMI.2016.2593957
- CIViC: Griffith, M., Spies, N. C., Krysiak, K., et al. (2017). "CIViC is a community knowledgebase for expert crowdsourcing the clinical interpretation of variants in cancer." Nature Genetics 49 (2): 170β174.
- ClinGen: Rehm, H. L., Berg, J. S., Brooks, L. D., et al. (2015). "ClinGen β The Clinical Genome Resource." New England Journal of Medicine 372 (23): 2235β2242. and Strande, N. T., Riggs, E. R., Buchanan, A. H., et al. (2017). "Evaluating the Clinical Validity of Gene-Disease Associations: An Evidence-Based Framework Developed by the Clinical Genome Resource." American Journal of Human Genetics 100 (6): 895β906.
- ClinSeek-Bench: Wu, J., Zhang, L., Wang, Y., Tu, H., Chen, H., Wang, Z., Xie, C., He, Y., Zhao, C., Xu, D., Tang, Y., & Zhou, Y. (2026). "ClinSeekAgent: Automating Multimodal Evidence Seeking for Agentic Clinical Reasoning." arXiv preprint arXiv:2605.20176. https://arxiv.org/abs/2605.20176
- CODE-15%: Ribeiro, A. H., PaixΓ£o, G. M. M., Lima, E. M., Horta Ribeiro, M., Pinto Filho, M. M., Gomes, P. R., Oliveira, D. M., Meira Jr, W., SchΓΆn, T. B., & Ribeiro, A. L. P. (2021). "CODE-15%: a large scale annotated dataset of 12-lead ECGs." Zenodo. https://doi.org/10.5281/zenodo.4916206
- HEAD-QA: Vilares, D., & GΓ³mez-RodrΓguez, C. (2019). "HEAD-QA: A Healthcare Dataset for Complex Reasoning." Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, 960β966.
- HyperKvasir: Borgli, H., Thambawita, V., Smedsrud, P. H., Hicks, S., Jha, D., Eskeland, S. L., et al. (2020). "HyperKvasir, a comprehensive multi-class image and video dataset for gastrointestinal endoscopy." Scientific Data 7: 283.
- ISIC: Gutman, D., Codella, N. C. F., Celebi, E., Helba, B., Marchetti, M., Mishra, N., & Halpern, A. (2016). "Skin Lesion Analysis toward Melanoma Detection: A Challenge at the International Symposium on Biomedical Imaging (ISBI) 2016, hosted by the International Skin Imaging Collaboration (ISIC)." arXiv preprint arXiv:1605.01397. https://arxiv.org/abs/1605.01397
- LiveQA: Ben Abacha, A., Agichtein, E., Pinter, Y., & Demner-Fushman, D. (2017). "Overview of the medical question answering task at TREC 2017 LiveQA." TREC.
- MedAgentGym: Xu, R., Zhuang, Y., Zhong, Y., Yu, Y., Wang, Z., Tang, X., Wu, H., Wang, M. D., Ruan, P., Yang, D., Wang, T., Xiao, G., Liu, X., Yang, C., Xie, Y., & Shi, W. (2025). "MedAgentGym: A Scalable Agentic Training Environment for Code-Centric Reasoning in Biomedical Data Science." arXiv preprint arXiv:2506.04405. https://arxiv.org/abs/2506.04405
- MedCaseReasoning: Wu, K., Wu, E., Thapa, R., Wei, K., Zhang, A., Suresh, A., Tao, J. J., Sun, M. W., Lozano, A., & Zou, J. (2025). "MedCaseReasoning: Evaluating and learning diagnostic reasoning from clinical case reports." arXiv preprint arXiv:2505.11733. https://arxiv.org/abs/2505.11733
- MEDEC: Ben Abacha, A., Yim, W., Fu, Y., Sun, Z., Yetisgen, M., Xia, F., & Lin, T. (2024). "MEDEC: A Benchmark for Medical Error Detection and Correction in Clinical Notes." arXiv preprint arXiv:2412.19260. https://arxiv.org/abs/2412.19260
- MedExpQA: Alonso, I., Oronoz, M., & Agerri, R. (2024). "MedExpQA: Multilingual Benchmarking of Large Language Models for Medical Question Answering." arXiv preprint arXiv:2404.05590. https://arxiv.org/abs/2404.05590
- MedMCQA: Pal, A., Umapathi, L. K., & Sankarasubbu, M. (2022). "MedMCQA: A Large-scale Multi-Subject Multi-Choice Dataset for Medical domain Question Answering." Conference on Health, Inference, and Learning (PMLR).
- MedQA: Jin, D., Pan, E., Oufattole, N., Weng, W.-H., Fang, H., & Szolovits, P. (2020). "What Disease Does This Patient Have? A Large-Scale Open Domain Question Answering Dataset from Medical Exams." arXiv preprint arXiv:2009.13081. https://arxiv.org/abs/2009.13081
- MedQuAD: Ben Abacha, A., & Demner-Fushman, D. (2019). "A question-entailment approach to question answering." BMC Bioinformatics 20: 511.
- Meissa: Chen, Y., Bai, X., Pan, Y., Zhou, Z., & Yuille, A. (2026). "Meissa: Multi-modal Medical Agentic Intelligence." arXiv preprint arXiv:2603.09018. https://arxiv.org/abs/2603.09018
- Mendeley Digital Knee X-Ray: Gornale, S., & Patravali, P. (2020). "Digital Knee X-ray Images." Mendeley Data, V1. https://doi.org/10.17632/t9ndx37v5h.1
- MIMIC-CXR: Johnson, A., Pollard, T., Mark, R., Berkowitz, S., & Horng, S. (2024). "MIMIC-CXR Database" (version 2.1.0). PhysioNet. https://physionet.org/content/mimic-cxr/2.1.0/ and Johnson, A. E. W., Pollard, T. J., Berkowitz, S. J., Greenbaum, N. R., Lungren, M. P., Deng, C.-Y., Mark, R. G., & Horng, S. (2019). "MIMIC-CXR, a de-identified publicly available database of chest radiographs with free-text reports." Scientific Data 6 (1): 1β8.
- MIMIC-IV-ECG: Gow, B., Pollard, T., Nathanson, L. A., Johnson, A., Moody, B., Fernandes, C., Greenbaum, N., Waks, J. W., Eslami, P., Carbonati, T., Chaudhari, A., Herbst, E., Moukheiber, D., Berkowitz, S., Mark, R., & Horng, S. (2023). "MIMIC-IV-ECG: Diagnostic Electrocardiogram Matched Subset" (version 1.0). PhysioNet. https://doi.org/10.13026/4nqg-sb35
- MIMIC-IV-ECHO: Gow, B., Pollard, T., Greenbaum, N., Moody, B., Johnson, A., Herbst, E., Waks, J. W., Eslami, P., Chaudhari, A., Carbonati, T., Berkowitz, S., Mark, R., & Horng, S. (2023). "MIMIC-IV-ECHO: Echocardiogram Matched Subset" (version 0.1). PhysioNet. https://doi.org/10.13026/ef48-v217
- MIMIC-IV-Note: Johnson, A., Pollard, T., Horng, S., Celi, L. A., & Mark, R. (2023). "MIMIC-IV-Note: Deidentified free-text clinical notes" (version 2.2). PhysioNet. https://doi.org/10.13026/1n74-ne17
- PAD-UFES-20: Pacheco, A. G. C., Lima, G. R., SalomΓ£o, A. S., Krohling, B., Biral, I. P., de Angelo, G. G., et al. (2020). "PAD-UFES-20: A skin lesion dataset composed of patient data and clinical images collected from smartphones." Data in Brief 32: 106221.
- PTB-XL: Wagner, P., Strodthoff, N., Bousseljot, R.-D., Kreiseler, D., Lunze, F. I., Samek, W., & Schaeffter, T. (2020). "PTB-XL, a large publicly available electrocardiography dataset." Scientific Data 7: 154.
- PubMedQA: Jin, Q., Dhingra, B., Liu, Z., Cohen, W. W., & Lu, X. (2019). "PubMedQA: A Dataset for Biomedical Research Question Answering." Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP).
- SCIN: Ward, A., Li, J., Wang, J., Lakshminarasimhan, S., Carrick, A., Campana, B., Hartford, J., et al. (2024). "Creating an Empirical Dermatology Dataset Through Crowdsourcing With Web Search Advertisements." JAMA Network Open 7 (11): e2446615.
- SIMORD and SYNUR: Corbeil, J.-P., Ben Abacha, A., Michalopoulos, G., Swazinna, P., Del-Agua, M., Tremblay, J., Jeeson Daniel, A., Bader, C., Cho, K., Krishnan, P., Bodenstab, N., Lin, T., Teng, W., Beaulieu, F., & Vozila, P. (2025). "Empowering Healthcare Practitioners with Language Models: Structuring Speech Transcripts in Two Real-World Clinical Applications." Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing: Industry Track.
- SLAKE: Liu, B., Zhan, L.-M., Xu, L., Ma, L., Yang, Y., & Wu, X.-M. (2021). "SLAKE: A Semantically-Labeled Knowledge-Enhanced Dataset for Medical Visual Question Answering." arXiv preprint arXiv:2102.09542. https://arxiv.org/abs/2102.09542
- TCGA: The results shown here are in whole or part based upon data generated by the TCGA Research Network: https://www.cancer.gov/tcga.
- TCIA B-mode and CEUS Liver: Eisenbrey, J., Lyshchik, A., & Wessner, C. (2021). "Ultrasound data of a variety of liver masses" [Data set]. The Cancer Imaging Archive. https://doi.org/10.7937/TCIA.2021.v4z7-tc39
- Therapeutics Data Commons: Huang, K., Fu, T., Gao, W., Zhao, Y., Roohani, Y., Leskovec, J., Coley, C. W., Xiao, C., Sun, J., & Zitnik, M. (2021). "Therapeutics Data Commons: Machine Learning Datasets and Tasks for Drug Discovery and Development." Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks.
- ToolMind: Yang, C., Le, R., Xing, Y., An, Z., Chen, Z., Zhao, W. X., Song, Y., & Zhang, T. (2025). "ToolMind Technical Report: A Large-Scale, Reasoning-Enhanced Tool-Use Dataset." arXiv preprint arXiv:2511.15718. https://arxiv.org/abs/2511.15718
- Toucan: Xu, Z., Meza Soria, A., Tan, S., Roy, A., Agrawal, A. S., Poovendran, R., & Panda, R. (2025). "TOUCAN: Synthesizing 1.5M Tool-Agentic Data from Real-World MCP Environments." arXiv preprint arXiv:2510.01179. https://arxiv.org/abs/2510.01179
- VinDr-Mammo: Nguyen, H. T., Nguyen, H. Q., Pham, H. H., Lam, K., Le, L. T., Dao, M., & Vu, V. (2023). "VinDr-Mammo: A large-scale benchmark dataset for computer-aided diagnosis in full-field digital mammography." Scientific Data 10: 277. https://doi.org/10.1038/s41597-023-02100-7
- VQA-RAD: Lau, J. J., Gayen, S., Ben Abacha, A., & Demner-Fushman, D. (2018). "A Dataset of Clinically Generated Visual Questions and Answers about Radiology Images." Scientific Data 5 (1): 1β10.
Data Preprocessing
De-identification/anonymization
Google and its partners utilize datasets that have been rigorously anonymized or de-identified, designed to protect individual research participants and patient privacy.
Base model (Gemma 4) pre-training data filtering
- CSAM Filtering: Rigorous CSAM (Child Sexual Abuse Material) filtering was applied at multiple stages in the data preparation process to ensure the exclusion of harmful and illegal content.
- Sensitive Data Filtering: As part of making Gemma pre-trained models safe and reliable, automated techniques were used to filter out certain personal information and other sensitive data from training sets.
- Additional methods: Filtering based on content quality and safety in line with our policies.
Ethics and Safety
MedGemma 2 was developed by Google and underwent safety evaluations aligned with those used for Gemma 4.
Evaluation Approach
MedGemma 2 was developed in partnership with internal safety and responsible AI teams. Our evaluation methods include structured evaluations and internal red-teaming testing of relevant content policies. Red-teaming was conducted by a number of different teams, each with different goals and human evaluation metrics. These evaluations align with Google's AI principles, as well as safety policies, which aim to prevent our generative AI models from generating harmful content, including:
- Child safety: Evaluation of text-to-text, image-to-text, and video-to-text prompts covering child safety policies, including child sexual abuse and exploitation.
- Content safety: Evaluation of text-to-text and image-to-text prompts covering safety policies, including harassment, violence and gore, and hate speech, as well as unjustified refusals of benign requests.
- Representational harms: Evaluation of text-to-text and image-to-text prompts covering safety policies, including bias, stereotyping, and harmful associations or inaccuracies.
- Ungrounded content: Evaluation of whether responses make factual assertions that are not supported by the provided context.
- General medical harms: Evaluation of text-to-text and image-to-text prompts covering safety policies, including information quality and potentially harmful responses or inaccuracies.
- Audio (4B only): Evaluation of audio-to-text prompts covering the same content and medical safety policies, as well as transcription accuracy for medical speech.
Safety evaluations were run with reasoning (thinking mode) both enabled and disabled.
In addition to development level evaluations, we conduct "assurance evaluations" which are our "arms-length" internal evaluations for responsibility governance decision making. They are conducted separately from the model development team and inform decision making about release. High-level findings are fed back to the model team but prompt sets are held out to prevent overfitting and preserve the results' ability to inform decision making. Notable assurance evaluation results are reported to our Responsibility & Safety Council as part of release review.
Clinical safety evaluation
Beyond the general safety evaluations, MedGemma 2 was assessed by clinicians for clinical safety. These pre-release clinical safety assessments were conducted on text-based prompts solely to evaluate baseline risk prior to release.
Evaluation Results
Per our internal safety testing and release standards, we saw acceptable levels of performance across the categories of child safety, content safety, and representational harms, consistent with or improved relative to the Gemma 4 base models. On clinical safety, both MedGemma 2 models performed comparably to or better than earlier MedGemma models of similar size, though these results have limited applicability, as these base models are intended solely as a starting point for further adaptation before any clinical use. All testing was conducted without safety filters to evaluate the model capabilities and behaviors. Evaluations covered text-to-text, image-to-text, and, for the 4B model, audio-to-text inputs. A limitation of our evaluations is that they included primarily English language prompts.
Usage and Limitations
These models have certain limitations that users should be aware of.
Intended Usage
MedGemma is an open multimodal generative AI model intended to be used as a starting point that enables more efficient development of downstream healthcare applications involving medical text and images. MedGemma is intended for developers in the life sciences and healthcare space. Developers are responsible for training, adapting, and making meaningful changes to MedGemma to accomplish their specific intended use. MedGemma models can be fine-tuned by developers using their own proprietary data for their specific tasks or solutions.
MedGemma is based on Gemma 4 and has been further trained on de-identified medical images, audio, and text. MedGemma enables further development in medical contexts (image, textual, and audio); however, the model has been trained using medical text/documents and electronic health records (EHR) data, chest x-ray, histopathology, dermatology, fundus images, CT, MRI, ECG images, surgical video, medical audio, ultrasound, mammography, genomics data, and agentic tool-use trajectories. Examples of tasks within MedGemmaβs training include visual question answering pertaining to medical images, such as radiographs, document understanding, native tool calling (e.g., FHIR/EHR queries) and literature search, medical audio understanding and dictation or providing answers to textual medical questions.
MedGemma is not intended to be used without appropriate validation, adaptation, and/or making meaningful modification by developers for their specific use case. The outputs generated by MedGemma are not intended to directly inform clinical diagnosis, patient management decisions, treatment recommendations, clinical calculations or any other direct clinical practice applications, including mental and behavioral health applications. The model does not provide live audio recording, streaming microphone capture, or ambient listening. All outputs from MedGemma should be considered preliminary and require independent verification, clinical correlation, and further investigation through established research and development methodologies.
Limitations
- Tool use and code execution
- MedGemma is provided strictly as open weights. Tool calls and code generated by MedGemma should be validated and executed within appropriately permissioned, sandboxed environments; developers are solely responsible for the validation, security, execution and correctness of any tools, APIs, or data sources connected to the model.
- Grounding
- Grounded responses depend on the quality and relevance of the supplied reference material; MedGemma may still produce content not supported by the provided sources.
- Modalities and model variants
- Medical audio support is available only in the 4B model.
- Quantized and converted models
- Quantized and community-converted versions (for example, GGUF, LiteRT, MLX) may perform differently from the original BF16 weights and should be validated separately.
- Training data
- The quality and diversity of the training data significantly influence the model's capabilities. Biases or gaps in the training data, such as underrepresentation of certain patient populations, care settings, languages, or imaging devices, can lead to limitations in the model's responses.
- The scope of the training data determines the medical tasks and modalities the model can handle effectively. Performance on tasks or modalities not represented in training has not been established.
- Context and task complexity
- Models generally perform best on tasks framed with clear prompts and instructions. Open-ended or highly complex clinical tasks might be challenging.
- A model's performance can be influenced by the amount and relevance of the context provided.
- Factual accuracy
- Models generate responses based on information they learned from their training datasets, but they are not knowledge bases. They may generate incorrect or outdated medical statements, including statements that do not reflect current clinical guidelines.
- Common sense
- Models rely on statistical patterns in data. They might lack the ability to apply common sense or clinical judgment in certain situations.
When adapting MedGemma developers should consider the following:
- Bias in validation data: As with any research, developers should ensure that any downstream application is validated to understand performance using data that is appropriately representative of the intended use setting for the specific application (e.g., age, sex, gender, condition, imaging device, etc).
- Data contamination concerns: When evaluating the generalization capabilities of a large model like MedGemma in a medical context, there is a risk of data contamination, where the model might have inadvertently seen related medical information during its pre-training, potentially overestimating its true ability to generalize to novel medical concepts. Developers should validate MedGemma on datasets not publicly available or otherwise made available to non-institutional researchers to mitigate this risk.
Ethical Considerations and Risks
The development of medical generative AI models raises several ethical concerns. In creating an open model, we have carefully considered the following:
- Bias and fairness
- Models trained on real-world medical data can reflect demographic, geographic, and clinical biases in that data, for example differences across patient populations, care settings, and imaging devices. MedGemma 2 underwent careful data curation and the post-training evaluations reported in this card to help mitigate the risk of these biases.
- Misinformation and misuse
- Models can be misused to generate medical content that is false, misleading, or harmful.
- Guidelines for responsible use are provided in the Responsible Generative AI Toolkit, and use of MedGemma is governed by the Health AI Developer Foundations Terms of Use and Prohibited Use Policy.
- Transparency and accountability
- This model card summarizes details on the models' architecture, capabilities, limitations, and evaluation processes.
- A responsibly developed open model offers the opportunity to share innovation by making medical AI technology accessible to developers and researchers across the healthcare and life sciences ecosystem.
Risks identified and mitigations:
- Generation of harmful or clinically unsafe content: Mechanisms and guidelines for content safety are essential. Developers are encouraged to exercise caution, validate outputs, and implement appropriate safeguards, including clinical review, based on their specific product policies and application use cases.
- Misuse for malicious purposes: Technical limitations and developer education can help mitigate against malicious applications. The Health AI Developer Foundations Terms of Use and Prohibited Use Policy set out restrictions on how MedGemma may be used.
- Privacy violations: MedGemma 2 was trained on de-identified, licensed, public, and synthetic datasets (see Data card). Developers are responsible for complying with applicable privacy regulations and for using privacy-preserving techniques when handling patient data.
- Perpetuation of biases: Developers are encouraged to perform continuous monitoring (using evaluation metrics and human review) and to explore de-biasing techniques during fine-tuning and other adaptation.
Benefits
- Provides strong baseline medical image, audio, and text comprehension for models of its size.
- This strong performance makes it efficient to adapt for downstream healthcare-based use cases.
- Native tool calling and long context enable developer workflows that assemble context across disparate healthcare data schemas (e.g., FHIR) when paired with external execution environments.
- A range of sizes, from on-device to server, lets developers choose the right model for their deployment constraints.
- This adaptation may involve prompt engineering, grounding, agentic orchestration or fine-tuning depending on the use case, baseline validation requirements, and desired performance characteristics.
Citation
When using this model, please cite:
@article{sellergren2026open,
title={An open vision-language model for diverse medical applications},
author={Sellergren, Andrew and Kazemzadeh, Sahar and Mahvar, Fereshteh and Kiraly, Atilla and Traverse, Madeleine and Kohlberger, Timo and Gao, Chufan and Jaroensri, Ronnachai and Xu, Shawn and Jamil, Fayaz and others},
journal={Nature Medicine},
pages={1--10},
year={2026},
publisher={Nature Publishing Group US, New York}
}
Release notes
MedGemma 2 4B IT
- Dec 3, 2026: Initial release
MedGemma 2 26B MoE IT
- Dec 3, 2026: Initial release
- Downloads last month
- 1