CoolFace
Apppublic

PANKAJ-MOHAN/colorectal-histology-classifier

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes
App README

Colorectal Cancer Tissue Classifier

EfficientNet-B0 fine-tuned on the NCT-CRC-HE-100K dataset to classify H&E-stained colorectal tissue patches into 9 classes.


Model Performance

MetricValue
Validation Accuracy99.64%
ROC-AUC (all 9 classes)1.000
ArchitectureEfficientNet-B0
Parameters~5.3M
Training Epochs25

Tissue Classes

ClassDescription
ADIAdipose (fat) tissue
BACKBackground / non-tissue
DEBDebris / cellular artifacts
LYMLymphocytes (immune cells)
MUCMucus
MUSSmooth muscle
NORMNormal colon mucosa
STRTumor-associated stroma
TUMAdenocarcinoma epithelium (tumor)

Dataset

  • —NCT-CRC-HE-100K-NONORM — 100,000 non-normalized H&E patches (224×224 px, 0.5 µm/px)
  • —9 tissue classes, ~11,000 images per class
  • —Source: Kather et al., 2019 — Zenodo

Training Details

ComponentChoice
BackboneEfficientNet-B0 (ImageNet pretrained)
OptimizerAdamW (lr=1e-4, weight_decay=1e-4)
SchedulerCosineAnnealingLR
LossCrossEntropyLoss + label smoothing (0.1)
AugmentationRandomResizedCrop, HFlip, VFlip, Rotate90, ColorJitter, HueSaturation, GaussNoise
Batch Size64
Val Split15% (random, stratified by class)

Features

  • —Single-image inference with confidence scores for all 9 classes
  • —Grad-CAM heatmap showing which regions drive the prediction
  • —Probability bar chart for all classes
  • —Sample patches included for quick demo

Project Structure

├── app.py                  # Gradio demo (HF Spaces entry point)
├── requirements.txt
├── outputs/
│   └── best_model.pth      # Trained model checkpoint
├── assets/
│   └── samples/            # Example H&E patches for demo
└── src/
    ├── dataset.py          # Data loading & augmentation
    ├── model.py            # EfficientNet-B0 architecture
    ├── train.py            # Training loop
    ├── evaluate.py         # Metrics & visualisation
    └── gradcam.py          # Grad-CAM utilities

How to Run Locally

bash
git clone https://github.com/iitmstudent-2021/colorectal-histology-classifier_computer_vision
cd colorectal-histology-classifier_computer_vision
pip install -r requirements.txt
python app.py

Citation

bibtex
@article{kather2019predicting,
  title     = {Predicting survival from colorectal cancer histology slides using deep learning},
  author    = {Kather, Jakob Nikolas and others},
  journal   = {PLOS Medicine},
  year      = {2019},
  publisher = {Public Library of Science}
}

License

MIT License. Model weights released for research and educational use only. Not intended for clinical diagnosis.