histostateTissue types in colorectal H&E, named in your browser

A tissue classifier, built from the bottom up

Name the tissue in a colorectal H&E tile

A small CNN (convolutional neural network) I trained myself, from gradient descent on two weights up. It runs in your browser: pick a tile and it answers in milliseconds.

accuracy on held-out tiles from a second clinical center
94.7%
accuracy on held-out tiles from a second clinical center
weights, trained from scratch in PyTorch
93,193
weights, trained from scratch in PyTorch
tissue types in colorectal H&E (hematoxylin and eosin) slides
9
tissue types in colorectal H&E (hematoxylin and eosin) slides
pretrained weights or trainer libraries
0
pretrained weights or trainer libraries
Drop an H&E tile here, or click to choose onePNG or JPEG. It stays in your browser; nothing is uploaded.

Or try a test tile

Answer

The answer appears here.

What it learned, and what fooled it

A 97% validation score said little about slides from another clinic. Most of the project went into finding that out and fixing it honestly.

Two clinics, two stains

Two clinics, two stains

Validation tiles came from the same clinic as training and scored 97.8%. The test tiles come from a second center, where the staining looks different. So I split those into a set to tune on and a set to score once.

Read this step in the walkthrough
A shortcut at 28 pixels

A shortcut at 28 pixels

The 28-pixel model's best stroma and muscle feature fired hardest on darkly stained tiles. Stain color helps on the home clinic's slides and breaks on everyone else's.

Read this step in the walkthrough
Real structure at 64 pixels

Real structure at 64 pixels

At 64 pixels the same kind of feature fires on long, parallel, spindle-shaped nuclei, which is what smooth muscle looks like. Final test accuracy rose from 91.4% to 94.7%; more resolution helped more than more depth.

Read this step in the walkthrough