CoolFace
Modelpublic

abnuel/MedGemma-4b-ICD

sourceHugging Facegemmaupdated 6mo agoView on Hugging Face
2likes
Model Card

MedGemma-4b-ICD

Fine-tuned version of google/medgemma-4b-it for automated ICD medical coding from clinical text. Given a clinical note or diagnosis description, this model generates the corresponding ICD-10 code(s).

๐Ÿš€ Live Demo: spaces/abnuel/med-coding

Model Description

ICD (International Classification of Diseases) coding is a critical but labor-intensive clinical workflow. This model was fine-tuned using supervised fine-tuning (SFT) with TRL on a curated dataset of clinical text paired with ICD-10 codes, enabling automated code suggestion from free-text diagnoses and clinical documentation.

  • โ€”Base model: google/medgemma-4b-it
  • โ€”Fine-tuning method: SFT (Supervised Fine-Tuning) via TRL
  • โ€”Task: ICD-10 code generation from clinical text
  • โ€”Domain: Clinical NLP / Healthcare AI

Intended Uses

  • โ€”Assisting medical coders with ICD-10 code lookup from clinical notes
  • โ€”Supporting clinical decision support systems
  • โ€”Research into automated medical coding pipelines

How to Use

python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_id = "abnuel/MedGemma-4b-ICD"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto"
)

prompt = "Patient presents with type 2 diabetes mellitus with diabetic chronic kidney disease, stage 3."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

outputs = model.generate(**inputs, max_new_tokens=64)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Training Details

  • โ€”Fine-tuning framework: TRL (Transformer Reinforcement Learning)
  • โ€”Method: Supervised Fine-Tuning (SFT)
  • โ€”Hardware: GPU (CUDA)
  • โ€”Base model license: Gemma terms of use

Limitations

  • โ€”Performance may vary on clinical notes with uncommon or highly specialized terminology.
  • โ€”Should not be used as a sole source of truth for billing or clinical decision-making without human review.
  • โ€”Trained on a specific dataset; generalization to all ICD-10 editions and specialties has not been fully evaluated.

Related Models & Resources

Citation

If you use this model in your research, please cite:

@misc{adegunlehin2025medgemma-icd,
  author = {Abayomi Adegunlehin},
  title  = {MedGemma-4b-ICD: Fine-tuned MedGemma for ICD-10 Medical Coding},
  year   = {2025},
  url    = {https://huggingface.co/abnuel/MedGemma-4b-ICD}
}