MedGemma 1.5 Fine-Tuned for Mammogram Analysis
This model is a fine-tuned version of google/medgemma-1.5-4b-it specialized for mammogram analysis and breast imaging interpretation.
Model Description
- Base Model: google/medgemma-1.5-4b-it (4B parameter multimodal model)
- Fine-tuning Method: QLoRA (4-bit quantization with LoRA)
- Training Data: CDD-CESM (Contrast-Enhanced Spectral Mammography) dataset
- Specialization: Breast imaging, mammogram interpretation, radiology reports
Capabilities
This fine-tuned model can:
- 🔬 Analyze mammogram images (CC and MLO views)
- 📝 Generate detailed radiological reports
- 🎯 Detect and characterize breast lesions
- 📊 Assess breast density (BI-RADS A-D)
- 💡 Provide clinical decision support recommendations
Usage
from transformers import AutoProcessor, AutoModelForImageTextToText
from PIL import Image
import torch
# Load model
model_id = "ageer/medgemma-1.5-mammogram-finetuned"
model = AutoModelForImageTextToText.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
processor = AutoProcessor.from_pretrained(model_id)
# Load and analyze mammogram
image = Image.open("mammogram.jpg")
messages = [
{
"role": "system",
"content": [{
"type": "text",
"text": "You are an expert radiologist specializing in breast imaging."
}]
},
{
"role": "user",
"content": [
{"type": "text", "text": "Analyze this mammogram and provide a detailed assessment."},
{"type": "image", "image": image}
]
}
]
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=500)
response = processor.decode(outputs[0], skip_special_tokens=True)
print(response)
Training Details
| Parameter | Value |
|---|---|
| Base Model | google/medgemma-1.5-4b-it |
| Fine-tuning Method | QLoRA |
| LoRA Rank | 16 |
| LoRA Alpha | 32 |
| Learning Rate | 2e-4 |
| Epochs | 3 |
| Training Data | CDD-CESM mammogram dataset (326 patients) |
⚠️ Important Disclaimer
This model is for research and educational purposes only.
- NOT approved for clinical use or medical diagnosis
- Should NOT replace professional medical advice
- Requires validation before any clinical application
- Model outputs should be reviewed by qualified radiologists
License
This model inherits the Health AI Developer Foundations License from MedGemma.
Model tree for ageer/medgemma-1.5-mammogram-finetuned
Base model
google/medgemma-1.5-4b-it