Histopathology patch encoder giving 1024-dimensional embeddings for slide search and cancer subtyping, trained on TCGA with weak slide labels.
No providers recorded yet. Browse all providers
The Cancer Genome Atlas records one primary diagnosis per whole-slide image, and a whole-slide image is a gigapixel file that no network can ingest whole. The usual fix — cut the slide into patches and stamp each with the slide's diagnosis — quietly poisons the training set, because most of the tissue on a cancer slide is stroma, fat, background, or genuinely healthy epithelium. Label all of it "lung adenocarcinoma" and the network learns that normal tissue is carcinoma.
KimiaNet's answer is to select patches rather than take them all. Cellularity — the fraction of a patch occupied by cell nuclei, measured by deconvolving the RGB image into its hematoxylin channel and thresholding — is a cheap proxy for the probability that a patch actually contains the tumour the slide is labelled with. The cellMosaic procedure builds a representative mosaic of each slide, then keeps only the most cellular fifth of it. What survives is a patch set for which the slide-level weak label is defensible — which is what makes a public archive carrying no pixel-level annotation usable as pretraining data at all.
The model itself is a DenseNet-121 retrained end to end on those patches by Kimia Lab at the University of Waterloo with clinical collaborators, and published in Medical Image Analysis in 2021. Its training head is a 30-way TCGA primary-diagnosis classifier, but the head is not the deliverable: downstream use is the 1024-dimensional vector from the final pooling layer, applied frozen. It belongs to the generation of pathology encoders that preceded the self-supervised, million-slide models — UNI, Virchow, Prov-GigaPath — and is trained on a single public archive at a single magnification rather than a curated multi-institution corpus.
requires_grad = False and returns the penultimate 1024-dimensional vector per patch, so the
encoder is reused as-is rather than re-fit per dataset.Training used 242,202 patches drawn from 7,126 diagnostic slides, with 24,646 validation patches from 741 slides and a disjoint 744-slide test set — 8,611 formalin-fixed paraffin-embedded slides in total, spanning 25 anatomic sites and 32 cancer subtypes before two under-populated classes were dropped. Frozen sections were excluded. Weights were initialised from ImageNet and optimised with Adam at a 1e-4 learning rate under cross-entropy for roughly 20 epochs on four V100 GPUs.
Evaluation is by search rather than by a fitted classifier. Retrieving tumour type across the 744 test slides with k-nearest-neighbour matching on barcoded features, KimiaNet averages 85.4% accuracy (std 11.6%) against 44.8% (std 19.9%) for an ImageNet DenseNet, and reaches the best result in every one of the 12 tumour-type groups. For subtype retrieval within an anatomic site it averages an F1 of 81 against 64, taking the top score in 23 of 26 subtypes. On two cohorts outside the pretraining data, an SVM on frozen KimiaNet features reaches 81.41% on a four-class endometrial dataset and 96.80% on the eight-class Kather colorectal texture set.
The natural use is content-based retrieval: given a query slide, find archival cases whose morphology matches, together with their diagnoses — the workflow a pathologist reaches for on a hard case. The same embeddings serve as the tile-level input to multiple-instance-learning pipelines for subtyping, grading, and biomarker prediction, and as a histology-specific alternative to ImageNet features. Keras and PyTorch checkpoints ship in the repository alongside sample extraction code.
KimiaNet is best read as a demonstration that domain pretraining on public, weakly labelled pathology data beats natural-image transfer by a wide margin, and it has been widely adopted as a frozen baseline encoder in downstream computational pathology work. Its limits are equally clear: the corpus is TCGA-only at one magnification, so institutional staining and scanner variation are underrepresented; the cellularity filter may bias the features toward high-grade morphology; and the released code carries no open-source license, distributed instead under a research-only end user agreement from a repository its maintainers describe as an archive of the lab's history.
Much of this page is generated or calculated automatically. Flag anything that looks off and we will re-run it.