Downloads · 30 days
75
14% of all-time downloads
chaudhrysuleman/medgemma-1.5-4b-it-leukemia-lora
medgemma-1.5-4b-it-leukemia-lora is a image-text-to-text model from chaudhrysuleman. 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 apache-2.0.
<p align="center" <img src="https://img.shields.io/badge/Accuracy-78.15%25-brightgreen" alt="Accuracy"/ <img src="https://img.shields.io/badge/Leukemia%20Recall-83.10%25-orange" alt="Recall"/ <img src="https://img.shi…
Downloads · 30 days
75
14% of all-time downloads
All-time downloads
540
Public
Repo size
129 MB
Likes
1
Public
Click a slice to open those files.
.safetensors95.3 MB · 74%
From the Hugging Face model README
medgemma-1.5-4b-it-leukemia-lora is a parameter-efficient fine-tuned vision-language model specialized for Acute Lymphoblastic Leukemia (ALL) detection from microscopic blood cell images.
Built on Google's MedGemma 1.5 4B IT foundation model and fine-tuned using LoRA (Low-Rank Adaptation), this model achieves high recall for leukemia detection—critical for medical screening applications where minimizing false negatives saves lives.
💡 Key Impact: Early detection of leukemia improves 5-year survival rates from 20% to over 85%.
THIS MODEL IS FOR RESEARCH AND EDUCATIONAL PURPOSES ONLY
| Metric | Value | Description |
|---|---|---|
| Accuracy | 78.15% | Overall classification correctness |
| Leukemia Recall | 83.10% | Ability to detect positive cases (sensitivity) |
| F1 Score | 83.24% | Harmonic mean of precision and recall |
| Test Set | 1,872 images | Unseen evaluation data |
| Training Set | ~10,000 images | C-NMC Leukemia Dataset |
| Attribute | Value |
|---|---|
| Base Model | google/medgemma-1.5-4b-it |
| Fine-tuning Method | LoRA (Parameter-Efficient Fine-Tuning) |
| Model Type | Vision-Language Model (VLM) |
| Task | Binary Classification (Normal vs. Leukemia) |
| Parameters | ~4B (base) + LoRA adapters |
| Input | Blood cell microscopy images + text prompt |
| Output | Classification label with reasoning |
The model was trained on the C-NMC Leukemia Classification Dataset, containing:
WARNING: This code is for educational/research demonstration only.
pip install transformers peft torch pillow
import os
import torch
from PIL import Image
from transformers import AutoProcessor, AutoModelForVision2Seq
from peft import PeftModel
BASE_MODEL_ID = "google/medgemma-1.5-4b-it"
LORA_ADAPTER_ID = "chaudhrysuleman/medgemma-1.5-4b-it-leukemia-lora"
hf_token = os.getenv("HF_TOKEN", "").strip() or None
processor = AutoProcessor.from_pretrained(
BASE_MODEL_ID,
trust_remote_code=True,
token=hf_token
)
base_model = AutoModelForVision2Seq.from_pretrained(
BASE_MODEL_ID,
trust_remote_code=True,
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
device_map="auto" if torch.cuda.is_available() else None,
token=hf_token
)
model = PeftModel.from_pretrained(base_model, LORA_ADAPTER_ID, token=hf_token)
model.eval()
image = Image.open("blood_cell.jpg").convert("RGB")
prompt = (
"Analyze this blood cell microscopy image and classify it.\n"
"Is the cell NORMAL or LEUKEMIA (blast)?\n"
"Answer with exactly one of: Normal, Leukemia."
)
messages = [{
"role": "user",
"content": [{"type": "image"}, {"type": "text", "text": prompt}]
}]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(images=image, text=text, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=10, do_sample=False)
print(processor.decode(outputs[0], skip_special_tokens=True))
🎮 Live Demo: LeukemiaScope on HuggingFace Spaces
| Use Case | Description | Context |
|---|---|---|
| Academic Research | Benchmarking medical VLMs on hematological imaging | University/research lab studies |
| Educational Demonstrations | Teaching LoRA fine-tuning on medical data | Workshops, courses, tutorials |
| Algorithm Development | Baseline for developing improved blood cell classifiers | Computer vision research |
| Transfer Learning | Foundation for other blood cell classification experiments | Research prototyping |
| Performance Comparison | Comparing against other medical AI approaches | Academic benchmarking |
Required Context: All uses must be in non-clinical, research, or educational settings with proper supervision and understanding of limitations.
| Use Case | Reason | Risk Level |
|---|---|---|
| Clinical Diagnosis | No regulatory approval (FDA/CE/etc.) | 🔴 CRITICAL |
| Patient Screening | Not validated on clinical populations | 🔴 CRITICAL |
| Treatment Decisions | Could lead to incorrect therapy | 🔴 CRITICAL |
| Sole Decision Maker | Must be combined with expert review | 🔴 CRITICAL |
| Emergency Medicine | Not designed for time-critical decisions | 🔴 CRITICAL |
| Self-Diagnosis | Patients should see qualified doctors | 🔴 CRITICAL |
| Insurance/Legal Purposes | Not legally admissible evidence | 🟡 HIGH |
| Non-blood Cell Images | Trained only on blood microscopy | 🟡 HIGH |
| Other Cancer Types | Specialized for ALL only, not AML/CML/CLL | 🟡 HIGH |
Legal Requirement: Any clinical application requires separate regulatory approval in your jurisdiction (FDA 510(k), CE-IVD marking, etc.).
Dataset Bias: Trained on a single public dataset (C-NMC); may not generalize to:
Population Representation: Dataset demographics may not reflect all patient populations
False Negatives/Positives: While optimized for high recall, some cases may be misclassified
| Setup | Memory | Inference Time |
|---|---|---|
| GPU (A100/H100) | ~8GB VRAM | ~1-2 sec/image |
| GPU (T4/V100) | ~10GB VRAM | ~3-5 sec/image |
| CPU | ~16GB RAM | ~30-60 sec/image |
If you use this model in your research, please cite:
@misc{medgemma-leukemia-lora-2026,
author = {Suleman, Chaudhry Muhammad and Idnan, Muhammad},
title = {MedGemma Leukemia LoRA: Parameter-Efficient Fine-Tuning for Blood Cell Classification},
year = {2026},
publisher = {HuggingFace},
url = {https://huggingface.co/chaudhrysuleman/medgemma-1.5-4b-it-leukemia-lora}
}
| Resource | Link |
|---|---|
| 🤗 Model | chaudhrysuleman/medgemma-1.5-4b-it-leukemia-lora |
| 🚀 Demo | LeukemiaScope Space |
| 📊 Dataset | C-NMC Leukemia Dataset |
| 🧬 Base Model | google/medgemma-1.5-4b-it |
| 💻 GitHub | LeukemiaScope Repository |
This model is released under the Apache 2.0 License, consistent with the MedGemma base model license. See the LICENSE file for details.
We are committed to the responsible development and use of AI in healthcare:
Remember: This is a research tool, not a medical device. Human expertise saves lives, not AI alone. 🏥
Built with ❤️ for the MedGemma Impact Challenge 2026