Jesteban247/medgemma-brats-experiments
0
🧠 Medgemma-brats-experiments
This repository contains fine-tuning experiments using [unsloth/medgemma-4b-it](https://huggingface.co/unsloth/medgemma-4b-it) on BraTS and TextBraTS datasets for brain MRI and radiology text understanding. The experiments explore different LoRA configurations and their effects on domain adaptation, language specificity, and catastrophic forgetting.
🧩 Experimental Setup
- Base model: `unsloth/medgemma-4b-it`
- Datasets:
- 🧬 Jupitern52/TextBraTS
- 🧠 Kaggle BraTS20 Dataset
- Framework: Unsloth (LoRA fine-tuning)
- Training type: SFT (Supervised Fine-Tuning)
- Epochs: 1–2
- Loss curve:

⚙️ LoRA Configurations
📊 Quantitative Results
🧠 Qualitative Comparisons
Below are qualitative results comparing outputs across configurations using real generation excerpts.
🧩 Example 1 — Brain MRI Slice
Ground truth:
“Lesion in right frontal and parietal lobes with mixed signals. Edema and necrosis observed. Ventricular compression present.”
🖼️ Image: 
🔬 Example 2 — Histology / Blood Sample
🖼️ Image: 
🐶 Example 3 — Natural Image (Puppies)
🖼️ Image: 
💬 Observations
- Fine-tuning on domain data improves medical accuracy, especially MRI lesion descriptions.
- Higher LoRA ranks (e.g.,
r=16) slightly improve quantitative metrics but cause catastrophic forgetting — the model loses general descriptive ability on unrelated domains. - For small or specialized datasets, lighter LoRA configurations (
r=1,α=4, 1–2 epochs) offer the best balance between specialization and generalization. - In such limited-data scenarios, techniques like context engineering or prompt-based adaptation are often more efficient than full fine-tuning.
- This aligns with current research and discussions on when to fine-tune versus when to leverage better prompting strategies.
📚 References:
