Downloads · 30 days
0
convaiinnovations/medgemma-4b-ecginstruct-lora
medgemma-4b-ecginstruct-lora is a image-text-to-text model from convaiinnovations. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
Fine-tuned LoRA adapter for Google's MedGemma-4B-it model on the ECGInstruct dataset for automated ECG interpretation.
Downloads · 30 days
0
Access
Public
Updated Dec 10, 2025
Repo size
958 MB
Likes
1
Trending 1
Click a slice to open those files.
.pt617 MB · 47%
From the Hugging Face model README
Fine-tuned LoRA adapter for Google's MedGemma-4B-it model on the ECGInstruct dataset for automated ECG interpretation.
This is a LoRA (Low-Rank Adaptation) fine-tuned version of google/medgemma-4b-it trained on the PULSE-ECG/ECGInstruct dataset containing 1.15M ECG instruction-following examples.
Developed by: convaiinnovations
Base Model: google/medgemma-4b-it
Training Infrastructure: AIRAWAT (C-DAC) - 8x NVIDIA A100 40GB GPUs
Training Duration: ~40 hours (1 epoch)
Final Token Accuracy: 88.23%
Hardware:
Hyperparameters:
Training Metrics:
pip install transformers peft pillow torch
from transformers import AutoModelForImageTextToText, AutoProcessor
from peft import PeftModel
from PIL import Image
# Load base model
base_model_id = "google/medgemma-4b-it"
model = AutoModelForImageTextToText.from_pretrained(
base_model_id,
torch_dtype="auto",
device_map="auto"
)
# Load LoRA adapter
model = PeftModel.from_pretrained(
model,
"convaiinnovations/medgemma-4b-ecginstruct-lora"
)
# Load processor
processor = AutoProcessor.from_pretrained(base_model_id)
# Load ECG image
image = Image.open("ecg_image.png").convert("RGB")
# Prepare prompt
messages = [
{
"role": "user",
"content": [
{"type": "image"},
{"type": "text", "text": "Analyze this ECG and provide a detailed interpretation."}
]
}
]
# Process input
text = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = processor(text=[text], images=[[image]], return_tensors="pt", padding=True)
inputs = {k: v.to(model.device) for k, v in inputs.items()}
# Generate
outputs = model.generate(
**inputs,
max_new_tokens=512,
do_sample=False,
temperature=None,
top_p=None
)
# Decode
response = processor.decode(outputs[0], skip_special_tokens=True)
print(response)
This model can:
⚠️ Medical Disclaimer: This model is intended for research and educational purposes only. It should not be used as a substitute for professional medical advice, diagnosis, or treatment. Always consult qualified healthcare professionals for medical decisions.
If you use this model, please cite:
@misc{medgemma-ecginstruct-lora,
author = {convaiinnovations},
title = {MedGemma-4B ECGInstruct LoRA},
year = {2025},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/convaiinnovations/medgemma-4b-ecginstruct-lora}}
}
Apache 2.0 (following base model license)