Method / tool

tiling

The mandatory decomposition of a gigapixel whole-slide image into fixed-size patches for deep-learning inference or training — patch size, overlap, tissue masking, and coordinate bookkeeping are engineering decisions that determine every downstream model's input distribution.

The problem — A whole-slide image at 20× magnification is a gigapixel file: no GPU can ingest it in one pass. Every deep-learning workflow for digital pathology must first partition the slide into tiles. The partitioning step is routinely treated as a trivial preprocessing detail — fixed grid, default size, done. In practice, tile size, overlap, tissue-background masking, and the coordinate bookkeeping that maps predictions back to slide space are engineering decisions that shape the model's entire input distribution.

What it is / how it works — Tiling decomposes a WSI into a grid of non-overlapping or overlapping patches at a chosen magnification level (typically 256×256 or 512×512 px at 20× or 40×). A tissue mask — usually computed by Otsu thresholding in HSV space — filters out white-background patches; tiles below a coverage threshold (often 50%) are discarded. The retained patches are the instances in downstream MIL pipelines (e.g. ABMIL) or the training samples for patch-level classifiers. Overlap padding is added at tile boundaries when a network's receptive field must not be truncated — omitting it causes seam artefacts in segmentation outputs. Pyramid-level selection determines effective resolution: high magnification captures cellular morphology; lower levels see tissue architecture. Many production pipelines tile at multiple scales and concatenate representations.

Where it fits — Tiling sits at the ingest/qc boundary of digital pathology workflows, immediately after WSI loading (OpenSlide, tiatoolbox) and before any learning. It is a prerequisite for both patch-level classification and slide-level aggregation via MIL. Getting it right means maintaining a coordinate map so model outputs can be projected back onto the original slide for pathologist review — a requirement that is easy to skip and painful to retrofit.

Where it breaks — Tissue masking on H&E is straightforward; stain-normalisation and artifact-heavy slides (folds, air bubbles, pen marks) corrupt the mask and introduce artefact tiles into training. Fixed-grid tiling at one magnification destroys multi-scale context that pathologists use implicitly. And tile-level independence assumptions — baked into most MIL frameworks — break when a diagnostic feature spans tile boundaries. These failure modes are silent: the pipeline runs, the model trains, and only careful inspection of attention maps or spatial outputs reveals that the wrong tiles reached the model.

The tiling grid is not a neutral data loading step — it is a modelling choice. Document tile size, magnification, overlap, and masking parameters as first-class experimental metadata, and validate that the tissue-background mask is correct before any model sees the patches.

References

Appears in these notes

  • How to Prepare Microscopy Data for AIMost of the work of applying AI to microscopy is data preparation — formatting, normalization, tiling, and label hygiene — and the single most consequential decision is a split that respects the non-independence of microscopy data. Get the split wrong and every downstream metric is leaked, not earned.

← Back to the constellation