Validating a Foundation Model Pipeline for Breast Cancer Histopathology: UNI, UMAP, and Spatial QC
A whole-slide image (WSI) doesn't look like much to a neural network. It's a gigapixel file, often 100,000 by 100,000 pixels and tens of gigabytes on disk, and no architecture can ingest that as a single tensor. So the field works around it: slice the slide into thousands of small tiles, encode each tile into a compact feature vector, and treat the whole slide as a bag of those vectors. This post walks through the encoding step (UNI) and the validation checks that come right after it, in the context of a real pipeline predicting breast cancer biomarkers (ER, PR, HER2, Ki-67) from H&E-stained WSIs. Patch-based preprocessing: why tiling is unavoidable Tiling is the standard workaround for gigapixel inputs in digital pathology. In this pipeline, each slide is segmented for tissue (via HistoQC), then patched into 256×256 px tiles at 20x magnification using CLAM's preprocessing utilities. The output isn't raw image crops, it's coordinate metadata: an .h5 file per sl...