arXiv:2610.22087cs.CVOct 2026

Manuscript Offprint

arXiv:2610.22087

Pathology foundation models for training-free case retrieval in salivary gland tumors

Maximilian J. Roesel, Niklas Kiermeyer, Philipp Keyl, Frederick Klauschen

ABSTRACT

In pathology, pattern recognition relies on a frame of reference built through extensive training and experience, which may still fall short when encountering rare cancer subtypes. Archives of previously diagnosed tumors often contain relevant precedents, yet identifying the most relevant cases remains challenging. Here we explore whether content-based retrieval with current pathology foundation models facilitates rare cancer diagnostics without any task-specific training. Pathologists can query a digitized archive using a region of interest (ROI) from a whole slide image (WSI) and retrieve morphologically similar cases, along with their ICD-O codes and corresponding WSIs. The ROI can be selected manually or automatically using a gated attention-based multiple instance learning model. We evaluate our approach by leave-one-case-out on an imbalanced dataset of 137 salivary gland tumor cases spanning 12 ICD-O morphology categories, comparing four pathology foundation models (Atlas2, Atlas2-B, Atlas2-S, and UNI2h). Top-1/3/5 retrieval was 62.5%/76.7%/81.3% for Atlas2, 50.2/66.6/72.9% for UNI2h, 52.3%/71.5%/77.6% for Atlas2-B and 54.4/65.2/73.7% for Atlas2-S. Macro-averaged F1 ranged from 69.0% for the smallest model Atlas2-S to 76.6% for the largest model Atlas2 across the five classes with at least ten cases. Our modified Chamfer similarity separated correct from incorrect matches among the Top-5 more reliably for Atlas2 (AUC 0.754) than for Atlas2-B (0.679, p = 0.020) and Atlas2-S (0.653, p = 0.003), but not UNI2h (0.697, p = 0.196). Requiring no additional training or manual annotation, this approach makes departmental archives searchable with pathology foundation models, providing a low-barrier route to case-based differential diagnosis and extending the individual frame of reference to the collective experience of the department.

Introduction

Even as increasingly detailed methods of tissue characterization move toward clinical application, morphology remains the foundation of microscopic pathology (1). Mastering its interpretation requires years of training, building an internal frame of reference against which unseen cases are compared (2). That frame of reference, however, is bounded by the cases an individual has encountered. Each rare entity is, by its nature, seldom seen, yet rare entities collectively make up a substantial part of the diagnostic spectrum. And while any individual pathologist encounters a given entity only occasionally, a department accumulates such cases over years. Once digitized as whole slide images (WSIs), these institutional archives can become a valuable external frame of reference, yet searching through these archives is challenging due to the diverse morphology and size of WSIs (3).

Digitization has made histomorphology accessible to artificial intelligence (AI), which is advancing from research toward routine diagnostics (4). Neural networks can learn semantically meaningful representations of tissue directly from data, an approach known as deep learning (5, 6). Rather than learning a single task, foundation models (FMs) use self-supervised pre-training on large corpora of slides to learn general-purpose representations that can be used across downstream tasks (7, 8). While training classifiers is a common way to apply such representations, they require enough labelled cases per class to learn a decision boundary and return a label without morphological evidence behind it (9). Content-based retrieval avoids this by returning cases rather than labels (10-12). We built a search engine based on FM representations, letting pathologists query an institutional archive and explore whether current pathology FMs make this viable for rare entities without any task-specific training.

We evaluate our approach on salivary gland tumors as a proof-of-concept, a rare and morphologically challenging entity with an incidence of 5.2 per 1,000,000 person-years in Germany (13) and the WHO recognizing 21 malignant types (14), in addition to secondary tumors (15). While some entities cannot be reliably separated by their morphology (16) and new molecular findings continue to carve out new entities (17), initial histological assessment can guide the selection of ancillary testing. An archive of 137 cases spanning 12 ICD-O morphology categories was embedded with four pathology FMs and retrieval was evaluated using queries selected by a pathologist and by a gated attention-based multiple instance learning (ABMIL) model.