Instructions to use Mukilan06/MedGemma-Chromosome-VLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Mukilan06/MedGemma-Chromosome-VLM with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/medgemma-4b-it-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "Mukilan06/MedGemma-Chromosome-VLM") - Transformers
How to use Mukilan06/MedGemma-Chromosome-VLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Mukilan06/MedGemma-Chromosome-VLM") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Mukilan06/MedGemma-Chromosome-VLM", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Mukilan06/MedGemma-Chromosome-VLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Mukilan06/MedGemma-Chromosome-VLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mukilan06/MedGemma-Chromosome-VLM", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Mukilan06/MedGemma-Chromosome-VLM
- SGLang
How to use Mukilan06/MedGemma-Chromosome-VLM with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Mukilan06/MedGemma-Chromosome-VLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mukilan06/MedGemma-Chromosome-VLM", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Mukilan06/MedGemma-Chromosome-VLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mukilan06/MedGemma-Chromosome-VLM", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Unsloth Studio
How to use Mukilan06/MedGemma-Chromosome-VLM with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Mukilan06/MedGemma-Chromosome-VLM to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Mukilan06/MedGemma-Chromosome-VLM to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Mukilan06/MedGemma-Chromosome-VLM to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Mukilan06/MedGemma-Chromosome-VLM", max_seq_length=2048, ) - Docker Model Runner
How to use Mukilan06/MedGemma-Chromosome-VLM with Docker Model Runner:
docker model run hf.co/Mukilan06/MedGemma-Chromosome-VLM
𧬠MedGemma-Chromosome-VLM
A parameter-efficient Vision-Language Model for image-grounded cytogenetic report generation
Chromosome spread image in β structured, uncertainty-aware cytogenetics report out.
π Overview
MedGemma-Chromosome-VLM is a domain-adapted vision-language model for automated chromosome spread interpretation. Given a chromosome spread image, it generates an image-grounded structured report covering chromosome count, morphology, overlap status, image quality, findings, interpretation, and explicit uncertainty statements.
This repository ships LoRA adapter weights only, fine-tuned on top of Google's MedGemma-4B.
β οΈ Research use only. Not validated for clinical diagnosis, treatment decisions, prenatal diagnosis, or genetic counseling. All outputs require review by a qualified professional.
ποΈ Table of Contents
- Model Details
- Intended Uses
- Training Details
- Evaluation
- Hardware & Environmental Impact
- Biases & Limitations
- Usage
- Citation
- Acknowledgements
π Model Details
| Field | Value |
|---|---|
| Developed by | Mukilan A.M. |
| Base model | unsloth/medgemma-4b-it-unsloth-bnb-4bit |
| Model type | Vision-Language Model (VLM) |
| Architecture | MedGemma-4B + LoRA |
| Fine-tuning method | Parameter-Efficient Fine-Tuning (LoRA, rank 32) |
| Frameworks | Transformers Β· PEFT Β· TRL Β· Unsloth |
| Language | English |
| Domain | Medical AI Β· Cytogenetics Β· Biomedical Image Analysis |
The model is fine-tuned with LoRA using completion-only supervised fine-tuning (SFT) β only assistant response tokens contribute to the loss. The visual encoder is frozen; only language projection layers are updated. The training objective favors conservative, image-grounded reports that avoid hallucinating abnormalities.
π― Intended Uses
Downstream applications: digital pathology workflows, laboratory decision-support systems, chromosome visualization tools, medical AI assistants, biomedical VLM research.
ποΈ Training Details
Dataset
| Split | Images |
|---|---|
| Train | ~4,200 |
| Validation | 300 |
| Test | 300 |
Each sample pairs a chromosome spread image (resized to 448 Γ 448) with a structured annotation: cytogenetic description, morphology, chromosome count, findings, interpretation, and uncertainty statement.
Image preprocessing: EXIF correction β RGB conversion β CLAHE enhancement β auto contrast β bicubic resizing β white letterbox padding.
LoRA Configuration
| Parameter | Value |
|---|---|
| Rank (r) | 32 |
| Alpha | 64 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Vision encoder | Frozen |
| Language layers | Trainable |
| RSLoRA | Enabled |
Hyperparameters
| Parameter | Value | Parameter | Value | |
|---|---|---|---|---|
| Epochs | 6 | Warmup ratio | 0.05 | |
| Learning rate | 8e-5 | Max sequence length | 2048 | |
| Optimizer | paged_adamw_8bit |
Image size | 448 | |
| Weight decay | 0.01 | Seed | 3407 | |
| Batch size | 1 | Grad. accumulation | 16 | |
| Effective batch size | 16 |
Quantization
4-bit NF4 Β· Double Quantization Β· BF16 compute Β· Flash Attention 2 (when available)
π Evaluation
Model selection was performed on validation loss.
| Metric | Value |
|---|---|
| Best checkpoint | checkpoint-250 |
| Validation loss | β 0.430 |
Additional evaluation axes: BLEU, ROUGE-L, token-level F1, and medical consistency evaluation.
βοΈ Hardware & Environmental Impact
| GPU | NVIDIA L4 |
| Precision | BF16 |
| Quantization | 4-bit |
| Training time | ~2.5β3 hours |
β οΈ Biases & Limitations
- Inherits limitations from base MedGemma and the fine-tuning dataset
- Dataset skews toward normal chromosome count (46), limiting rare-abnormality generalization
- Cannot replace expert cytogenetic interpretation
- Possible degradation on low-quality input images
- Conservative reporting style may omit subtle abnormalities
Ethical considerations: intended solely for research and education. Must not be used as an autonomous diagnostic system β all outputs require review by qualified medical professionals.
π» Usage
pip install unsloth peft transformers
from unsloth import FastVisionModel
from peft import PeftModel
base_model = FastVisionModel.from_pretrained(
"unsloth/medgemma-4b-it-unsloth-bnb-4bit"
)
model = PeftModel.from_pretrained(
base_model,
"Mukilan06/MedGemma-Chromosome-VLM"
)
π Citation
If you use this model in academic work, please cite:
@misc{mukilan2026medgemmachromosomevlm,
title={MedGemma-Chromosome-VLM: A Parameter-Efficient Vision Language Model for Image-Grounded Cytogenetic Report Generation},
author={Mukilan A. M.},
year={2026},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/Mukilan06/MedGemma-Chromosome-VLM}}
}
π Acknowledgements
This work builds upon Google MedGemma, Gemma, Unsloth, Hugging Face Transformers, PEFT, and TRL. Special thanks to the open-source AI community for enabling efficient medical vision-language model development.
Made with 𧬠by Mukilan A.M.
- Downloads last month
- 14
Model tree for Mukilan06/MedGemma-Chromosome-VLM
Base model
google/gemma-3-4b-pt