About X-Pathology
The Engineering Journey
From Single Model to Multi-Specialist Platform
Building a reliable medical AI requires rigorous iteration. X-Pathology has evolved through four major architectural versions — from a binary VGG16 baseline to a multi-specialist platform with temperature-calibrated CNN models for both colorectal histopathology and brain tumor MRI classification, each with Grad-CAM explainability and Gemini-powered dual-persona reporting.
Select Specialist & Upload
Choose the specialist model — Colon (H&E histopathology patch) or Brain (T1-weighted MRI scan). Upload via drag-and-drop, file picker, or the pre-loaded sample gallery.
Specialist CNN Inference
The selected specialist model processes the image: EfficientNetB1 for 9-class colorectal tissue classification (240×240) or EfficientNetB0 for 4-class brain tumor classification (224×224).
Temperature-Calibrated Confidence
Post-training temperature scaling converts raw logits into calibrated probabilities. Colon uses T=0.5576, Brain uses T=0.7867 — each tuned on its holdout set.
Grad-CAM XAI Heatmap
Gradient-weighted Class Activation Mapping targets specialist-specific layers — block7a_project_bn for Colon, top_conv for Brain — generating visual explanations of what the CNN focused on.
Gemini 3.1 Flash Lite LLM Analysis
Both the original image and Grad-CAM overlay are sent to Gemini with domain-adapted prompts — pathology terminology for colon, radiology terminology for brain MRI. A dual-persona report is generated.
Dual-Persona Report
The final dashboard displays: the original image, Grad-CAM overlay, full probability breakdown, a Clinical/Radiology Report for professionals, and a compassionate Patient-Facing Summary.
TensorFlow / Keras
Deep learning backbone powering the EfficientNetB1 Colon Specialist (9-class) and EfficientNetB0 Brain Specialist (4-class) with temperature-calibrated inference.
FastAPI
High-performance async Python backend with dynamic multi-specialist model routing, Grad-CAM generation, and calibrated probability computation.
Next.js 16
React-based frontend with App Router, specialist selection UI, interactive sample galleries, and a premium clinical-grade dark theme.
Gemini 3.1 Flash Lite
Google's multimodal LLM receives domain-adapted prompts per specialist, visually verifying heatmaps and generating dual-persona clinical reports.
Grad-CAM
Explainable AI technique generating visual heatmaps via specialist-specific convolutional layers — block7a_project_bn for colon, top_conv for brain.
Hugging Face Hub
Cloud-based model hosting for both specialists — Xpathology-Colon-Specialist and xpathology-brain-specialist — with versioned weights and calibration assets.
The EfficientNetB1 Colon Specialistclassifies H&E-stained colorectal tissue patches into 9 distinct tissue categories. Only the TUM class is considered clinically neoplastic (malignant).
Adipose Tissue
Fat tissue surrounding the colonBackground
Non-tissue background regionsDebris / Necrosis
Cellular debris and necrotic tissueLymphocytes
Immune cell aggregates and infiltratesMucus
Mucinous secretions and poolsSmooth Muscle
Muscularis propria / muscularis mucosaeNormal Colon Mucosa
Healthy epithelial glandular tissueCancer-Associated Stroma
Desmoplastic stromal reaction tissueColorectal Adenocarcinoma
Tumour epithelium — neoplasticThe EfficientNetB0 Brain Specialist classifies T1-weighted axial brain MRI scans into 4 diagnostic categories. Glioma is flagged as high concern, while meningioma and pituitary tumors are flagged as moderate concern.
Glioma
Most aggressive primary brain tumor — morphologically heterogeneous across MRI slicesMeningioma
Typically benign, arises from meninges — can overlap with glioma on 2D slicesPituitary Tumor
Tumor of the pituitary gland in the sella turcica — lower-centre brain regionNo Tumor Detected
Normal brain MRI scan — no abnormal mass identified