Downloads · 30 days
12
10% of all-time downloads
Manusinhh/medgemma-finetuned-cxr-reasoning
medgemma-finetuned-cxr-reasoning is a machine learning model from Manusinhh. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This is a fine-tuned version of google/medgemma-4b-it, trained on the CXR-10K Reasoning Dataset consisting of chest X-ray images paired with step-by-step clinical reasoning.
Downloads · 30 days
12
10% of all-time downloads
All-time downloads
124
Public
Parameters
5B
10 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors9.9 GB · 100%
From the Hugging Face model README
This is a fine-tuned version of google/medgemma-4b-it, trained on the CXR-10K Reasoning Dataset consisting of chest X-ray images paired with step-by-step clinical reasoning.
Multimodal Clinical Reasoning:
Given a chest X-ray image, the model generates a step-by-step diagnostic reasoning path covering:
from transformers import AutoProcessor, AutoModelForImageTextToText
from PIL import Image
import torch
# Load model and processor
model = AutoModelForImageTextToText.from_pretrained("Manusinhh/medgemma-finetuned-cxr-reasoning")
processor = AutoProcessor.from_pretrained("google/medgemma-4b-it")
# Load image
image = Image.open("example.png").convert("RGB")
# Create prompt
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": "Analyze this medical image and provide step-by-step findings."}
]
}
]
# Tokenize and generate
inputs = processor.apply_chat_template(messages, tokenize=True, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(**inputs, max_new_tokens=300)
print(processor.decode(output[0], skip_special_tokens=True))
google/medgemma-4b-itpeft with low-rank adaptersTraining data derived from: CXR-10K Reasoning Dataset Built upon: itsanmolgupta/mimic-cxr-dataset-10k
Base dataset: MIMIC-CXR by MIT LCP
Johnson AE, Pollard TJ, Berkowitz SJ, et al. Scientific Data. 2019;6:317. https://doi.org/10.1038/s41597-019-0322-0