About X-Pathology
The Engineering Journey
From Proof-of-Concept to Specialist
Building a reliable medical AI requires rigorous iteration. X-Pathology has evolved through three major architectural versions — from a binary VGG16 baseline to a 9-class temperature-calibrated EfficientNetB1 Colon Specialist with external holdout validation.
Upload H&E Colorectal Patch
Upload a histopathology tissue section image (JPEG/PNG/TIFF). The system accepts standard H&E stained patches from colorectal biopsies at 240×240 resolution.
EfficientNetB1 CNN Inference
The Colon Specialist model classifies the tissue into one of 9 colorectal tissue types: Adipose, Background, Debris, Lymphocytes, Mucus, Smooth Muscle, Normal Mucosa, Cancer-Associated Stroma, or Tumour.
Temperature-Calibrated Confidence
Post-training temperature scaling (T=0.5576) converts raw logits into statistically calibrated probabilities. This ensures confidence scores reflect true predictive uncertainty.
Grad-CAM XAI Heatmap
Gradient-weighted Class Activation Mapping taps the last EfficientNet convolutional block (block7a_project_bn) to generate visual explanations of CNN attention regions.
Gemini 2.5 Flash LLM Analysis
Both the original H&E slide and the Grad-CAM overlay are sent to Google's Gemini multimodal model, which generates a dual-persona report with clinical pathology and patient-friendly sections.
Dual-Persona Report
The final output includes a structured Clinical Pathology Report for professionals and a compassionate plain-English Patient-Facing Summary, along with a 9-class probability breakdown and visual explanations.
TensorFlow / Keras
Deep learning backbone powering the EfficientNetB1 Colon Specialist for 9-class colorectal histopathology classification with temperature-calibrated inference.
FastAPI
High-performance async Python backend handling image preprocessing, CNN inference, Grad-CAM generation, and calibrated probability computation.
Next.js 16
React-based frontend framework with App Router, providing the clinical-grade dark UI with server-side rendering.
Gemini 2.5 Flash
Google's multimodal LLM that analyzes both the slide and heatmap to produce dual-persona clinical reports with visual verification.
Grad-CAM
Explainable AI technique generating visual heatmaps of CNN attention via the final EfficientNet convolutional block, making model decisions interpretable.
Hugging Face Hub
Cloud-based model hosting at rarfileexe/Xpathology-Colon-Specialist, enabling versioned model downloads with temperature calibration assets.
The EfficientNetB1 Colon Specialist classifies 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 — neoplastic