MedGemma-4B Anatomy v1.3 (Optimized)

Fine-tuned MedGemma-4B for anatomical and clinical reasoning.

Training Details

  • Base Model: google/medgemma-4b-it
  • Training Data: 164 samples
  • Validation: 19 samples
  • Method: LoRA (r=16, α=32)
  • Epochs: 3
  • Training Time: 1.42 hours
  • Hardware: Google Colab (14-15GB VRAM)

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_name = "krishna195/medgemma-anatomy-v1.3"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    device_map="auto"
)

question = "What structures form the boundaries of the femoral triangle?"
prompt = f"<start_of_turn>user\n{question}<end_of_turn>\n<start_of_turn>model\n"

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Performance

  • Inference Speed: ~30-40 tokens/sec (T4)
  • Memory: 8-9GB (bfloat16), 3-4GB (4-bit)
  • Final Training Loss: 14.2034

Focus Areas

  • Orthopedic injuries
  • Nerve anatomy
  • Clinical presentations
  • Diagnostic workflows
  • Management protocols

License

Apache 2.0

Downloads last month
5
Safetensors
Model size
4B params
Tensor type
F32
·
U8
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for krishna195/medgemma-anatomy-v1.3

Quantized
(35)
this model