Downloads · 30 days
12
18% of all-time downloads
ajitonelson/gemma-fetal-ultrasound
gemma-fetal-ultrasound is a image-text-to-text model from ajitonelson. 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 peft. The card lists the license as gemma.
Fine-tuned Gemma 4 E4B (multimodal) for classifying fetal anatomical planes in obstetric ultrasound images. Designed to assist non-specialist community health workers in remote villages (Timor-Leste and similar settin…
Downloads · 30 days
12
18% of all-time downloads
All-time downloads
66
Public
Repo size
172 MB
Likes
0
Public
Click a slice to open those files.
.safetensors140 MB · 81%
From the Hugging Face model README
Fine-tuned Gemma 4 E4B (multimodal) for classifying fetal anatomical planes in obstetric ultrasound images. Designed to assist non-specialist community health workers in remote villages (Timor-Leste and similar settings) in capturing diagnostic-quality images for remote review by specialists.
Built for the Gemma 4 Good Hackathon — Health & Sciences track.
| Class | Precision | Recall | F1 |
|---|---|---|---|
| Fetal Brain | 0.98 | 0.95 | 0.96 |
| Maternal Cervix | 1.00 | 0.98 | 0.99 |
| Fetal Femur | 0.78 | 0.88 | 0.83 |
| Fetal Thorax | 0.68 | 0.93 | 0.79 |
| Other | 0.91 | 0.77 | 0.84 |
| Fetal Abdomen | 0.70 | 0.66 | 0.68 |
from unsloth import FastVisionModel
# Load base Gemma 4 + this LoRA
model, tokenizer = FastVisionModel.from_pretrained(
"unsloth/gemma-4-E4B-it",
load_in_4bit=True,
)
model.load_adapter("ajitonelson/gemma-fetal-ultrasound")
# Run inference on an ultrasound image
from PIL import Image
img = Image.open("ultrasound.png").convert("RGB")
messages = [{"role": "user", "content": [
{"type": "image"},
{"type": "text", "text": "Identify the fetal anatomical plane shown."},
]}]
input_text = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
inputs = tokenizer(img, input_text, return_tensors="pt").to("cuda")
out = model.generate(**inputs, max_new_tokens=80, do_sample=False)
print(tokenizer.decode(out[0], skip_special_tokens=True))
unsloth/gemma-4-E4B-it (Gemma 4 E4B, multimodal)Burgos-Artizzu, X.P. et al. Evaluation of deep convolutional neural networks for automatic classification of common maternal fetal ultrasound planes. Sci Rep 10, 10200 (2020). https://doi.org/10.1038/s41598-020-67076-5
This model is a proof-of-concept for image-acquisition assistance, not a diagnostic medical device. It is not validated for clinical use. Always consult qualified medical professionals for diagnosis and care decisions.
Inherits the Gemma 4 license from the base model.