Medigent One — Gemma 4 E4B CRC Tissue Classifier

LoRA adapter for unsloth/gemma-4-E4B-it, fine-tuned for 9-class colorectal cancer tissue classification from H&E-stained histology patches.

This adapter is the fine-tuning proof point referenced in our Medigent One Gemma 4 Good Hackathon submission. The full Medigent One stack (a six-agent medical reasoning panel built on Gemma 4 31B) ships separately at https://github.com/a7m-1st/medigent-one. The adapter itself is not deployed in the production Medigent One stack — it is published here as a reproducible demonstration that Gemma 4 E4B can be specialized for medical vision when needed.

Task

9-class tissue classification from H&E-stained colorectal cancer patches: ADI | BACK | DEB | LYM | MUC | MUS | NORM | STR | TUM

Training

Base model unsloth/gemma-4-E4B-it
Method LoRA via Unsloth (r=16, alpha=16, target_modules=all-linear)
Trainable params 41,222,144 (0.51% of 8.04B)
Dataset NCT-CRC-HE-100K (9,000 training samples, seed=42)
Steps 300 (~0.27 epochs, effective batch 8)
Optimizer adamw_torch_fused, LR 2e-4, cosine schedule, warmup 0.03
Hardware NVIDIA RTX PRO 6000 Blackwell (94 GB)
Precision bfloat16

Results

Evaluated on 500 samples from each dataset, seed=42:

Dataset Pretrained acc Fine-tuned acc F1 (weighted) Δ
Dataset A — NCT-CRC-HE-100K (in-distribution) 29.0% 90.6% 0.91 +61.6 pp
Dataset B — CRC-VAL-HE-7K (held-out) 22.4% 76.0% 0.72 +53.6 pp

Zero malformed outputs across 1000 evaluations. Random chance on this 9-class task is 11.1%.

The sweet spot is narrow: longer training (3 epochs) collapses the model into a single dominant class. The 300-step recipe at effective batch 8 with LR 2e-4 lands inside that window.

Usage

from unsloth import FastModel

model, processor = FastModel.from_pretrained(
    "a7m1st/medigent-one-gemma4-crc-lora",
    load_in_4bit=False,
    max_seq_length=2048,
    full_finetuning=False,
)

The full prompt used at both training and evaluation:

What type of tissue is shown in this histological image?
Choose from: ADI, BACK, DEB, LYM, MUC, MUS, NORM, STR, TUM.

Citation

@misc{medigent_one_2026,
  title  = {Medigent One},
  author = {Ahmed Awelkair and zl.fang and Nerissa Ibrahim and Bimo Kuncoro},
  year   = {2026},
  url    = {https://www.kaggle.com/competitions/gemma-4-good-hackathon/writeups/medigent-one-one-model-one-panel-of-specialists}
}

Acknowledgments

  • Google Gemma 4 team for the open-weights model
  • Unsloth team for the LoRA fine-tuning framework
  • 1aurent/NCT-CRC-HE dataset (originally from Kather et al.)

Gemma is a trademark of Google LLC.

Downloads last month
42
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for a7m1st/medigent-one-gemma4-crc-lora

Adapter
(35)
this model

Dataset used to train a7m1st/medigent-one-gemma4-crc-lora