CoolFace
Apppublic

KhushbakhtXS/medgemma-pathology-api

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes
App README

MedGemma Pathology API

A FastAPI backend serving a fine-tuned MedGemma model for H&E stained colorectal histopathology tissue classification.

Model

  • Base model: google/medgemma-1.5-4b-it
  • LoRA adapter: KhushbakhtXS/medgemma-pathology-lora

Tissue Classes

CodeDescription
ADIAdipose tissue
BACKBackground / slide artifact
DEBDebris / necrosis
LYMLymphocytic infiltrate
MUCMucinous component
MUSMuscularis propria / smooth muscle
NORMNormal colorectal mucosa
STRTumor-associated stroma
TUMTumor epithelium (urgent)

Endpoints

MethodPathDescription
GET/Service info
GET/healthHealth check
POST/classifyClassify a histopathology image patch

POST /classify

Form fields:

  • file (required) — image file (JPEG / PNG)
  • clinical_notes (optional) — free-text clinical context

Response:

json
{
  "tissue_type": "TUM",
  "confidence": "high",
  "reasoning": "Irregular glandular structures with nuclear pleomorphism.",
  "guidance": "Tumor epithelium identified. Correlate with grade and staging workup.",
  "urgent": true,
  "raw_output": "..."
}

Configuration

Set the HF_TOKEN Space secret to a Hugging Face token with read access to the gated MedGemma model.