arXiv:2610.25054cs.CVOct 2026

Manuscript Offprint

arXiv:2610.25054

PRET is a few-shot system for pan-cancer recognition without example training

Yi Li, Ziyu Ning, Tianqi Xiang, Qixiang Zhang, Zhihao Lin, Min Yi, Feiyan Feng, Baozhen Zeng, Xuexia Qian, Lu Sun, Jiace Qin, Ling Xiang, Chao Fan, Tian Qin, Qian Wang, Xiu-Wu Bian, Kun-Hsing Yu, Kang Zhang, Qingling Zhang, Xiaomeng Li

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Yi Li1,16^{1,16}, Ziyu Ning2,16^{2,16}, Tianqi Xiang1^{1}, Qixiang Zhang1^{1}, Zhihao Lin2^{2}, Min Yi3^{3}, Feiyan Feng2^{2}, Baozhen Zeng2^{2}, Xuexia Qian2^{2}, Lu Sun2^{2}, Jiace Qin2^{2}, Ling Xiang2^{2}, Chao Fan2^{2}, Tian Qin2^{2}, Qian Wang2^{2}, Xiu-Wu Bian4^{4}, Kun-Hsing Yu5,6,7,8^{5,6,7,8}, Kang Zhang9,10,11,12,∗^{9,10,11,12,*}, Qingling Zhang2,∗^{2,*}, Xiaomeng Li1,13,14,15,∗^{1,13,14,15,*}

1^{1}Department of Electronic and Computer Engineering, The Hong Kong University of Science and Technology, Hong Kong SAR, China.

2^{2}Department of Pathology, Guangdong Provincial People's Hospital (Guangdong Academy of Medical Sciences), Southern Medical University, Guangzhou, China.

3^{3}Department of Pathology, the Fifth People's Hospital of Qinghai Province, Qinghai Province Cancer Hospital, Xining, China.

4^{4}Institute of Pathology and Southwest Cancer Center, the First Affiliated Hospital (Southwest Hospital) and School of Basic Medical Sciences, Army Medical University (Third Military Medical University) and the Key Laboratory of Tumor Immunopathology, The Ministry of Education (Third Military Medical University), Chongqing, China.

5^{5}Department of Biomedical Informatics, Harvard Medical School, Boston, MA, USA.

6^{6}Department of Pathology, Brigham and Women's Hospital, Boston, MA, USA.

7^{7}Harvard Data Science Initiative, Harvard University, Cambridge, MA, USA.

8^{8}Kempner Institute for the Study of Natural and Artificial Intelligence, Harvard University, Cambridge, MA, USA.

9^{9}Institute for AI in Medicine, Faculty of Medicine, Macau University of Science and Technology, Macau SAR, China.

10^{10}Department of General Surgery, Zhejiang Key Laboratory of Intelligent Cancer Biomarker Discovery and Translation, The First Affiliated Hospital; Clinical Data Science Institute, Wenzhou Medical University, Wenzhou, China.

11^{11}Department of Hepatobiliary Surgery, Zhejiang Key Laboratory of Intelligent Cancer Biomarker Discovery and Translation, The First Affiliated Hospital; Clinical Data Science Institute, Wenzhou Medical University, Wenzhou, China.

12^{12}Guangzhou National Laboratory, Guangzhou, China.

13^{13}Department of Computer Science and Engineering, The Hong Kong University of Science and Technology, Hong Kong SAR, China.

14^{14}Shenzhen-Hong Kong Collaborative Innovation Research Institute, The Hong Kong University of Science and Technology, Shenzhen, China.

15^{15}Shenzhen Loop Area Institute, Shenzhen, China.

16^{16}These authors contributed equally: Yi Li, Ziyu Ning. *Corresponding authors: Kang Zhang (kang.zhang@gmail.com); Qingling Zhang (zhangqingling@gdph.org.cn); Xiaomeng Li (eexmli@ust.hk)

ABSTRACT

Pathological examination stands as the cornerstone in cancer diagnosis, impacting millions worldwide annually. With the shortage of pathologists globally, artificial intelligence (AI) has emerged rapidly to automate the diagnostics process. However, conventional AI models require substantial labeled data for each disease, posing huge challenges in scalability and practicality. Therefore, we introduce PRET (pan-cancer recognition without examples training), a few-shot system to achieve flexible, scalable, and effective cancer recognition across diverse organs, hospitals and tasks without training. Evaluated on 23 international benchmarks comprising 4,484 whole-slide images, our method outperforms existing approaches across 20 tasks, achieving over 97% area under the curve on 15 benchmarks with a maximum improvement of 36.76%. Notably, PRET delivers clinical-grade diagnostic performance in lymph node metastasis detection using only eight slide examples, outperforming 11 pathologists. By offering a flexible and cost-effective solution for pan-cancer recognition, PRET paves the way for accessible and equitable AI-based pathology systems, particularly benefiting minority populations and underserved regions.

Introduction

Pathological examination, the gold standard for cancer diagnosis, is indispensable for approximately 19.3 million new cancer diagnoses annually worldwide 1^{1}. However, the global scarcity of pathologists 2−4^{2-4} poses notable challenges, particularly in resource-limited settings. Computational pathology 5,6^{5,6} based on artificial intelligence (AI) has emerged as a solution for automating or assisting the cancer diagnosis, yet conventional AI algorithms are limited in disease generalizability and rely on extensive annotated data 7,8^{7,8}. For instance, Campanella et al. 7^{7} trained AI classification models for prostate cancer, skin cancer and lymph node metastases with nearly 45,000 whole-slide images (WSIs). Given that the OncoTree 9^{9} cataloged nearly 900 tumor types, the practical limitation of developing specific models for each disease type becomes evident, particularly in low-resource settings where access to expertise and labeled data is limited.

To overcome these barriers, developing a pan-cancer model capable of recognizing cancers with minimal data is crucial. Pan-cancer recognition aims to diagnose multiple cancers using a single general-purpose model, which differs from task-specific models 7,10,11 or pan-cancer analysis of genetic mutations 12,13 and biomarkers 14. The advent of pathological foundation models 11,12,15,16 has made pan-cancer representations more accessible. These models derive insights either from self-supervised models 12,16,17 trained on vast amounts of unlabeled images or from visual-language models 11,15 supervised by millions of textual labels. Despite their potential, these foundation models 11,16 are typically fine-tuned for specific downstream diseases and tasks using multiple weakly supervised models 10,18. However, their application in real-world scenarios is greatly hindered by the substantial training efforts required for various downstream tasks. In particular, self-supervised models 12,16,17 often involve substantial computational and expert resources to develop multiple classifiers for different tasks. Although some foundation methods 15,16 can bypass additional training, their performance is limited across foundation models and difficult to apply in clinical applications. This limitation primarily arises because pathological foundation models often rely on techniques such as MI-SimpleShot in UNI 16 and k-nearest neighbors (KNN) in HIPT 19. While these general methods are designed to evaluate the effectiveness of foundation models across diverse tasks, they fail to account for the rich local information inherent in WSIs, resulting in suboptimal results. Moreover, zero-shot classification in vision-language foundation models 11,15 typically depends on millions of labeled pre-training data, while exhibiting limited effectiveness on specific tasks or hospitals outside the pretrained datasets. Thus, there is a pressing need to develop an effective approach using a few examples without training for generalizing foundation models across various downstream tasks in real-world hospitals, particularly in underserved regions that lack AI expertise and minority populations with limited cases.

In this paper, we introduce pan-cancer recognition without examples training (PRET), an approach that eliminates the need for task-specific model training. Inspired by the concept of ‘prêt-à-porter’ (abbreviated as pret, which refers to ready-to-wear clothing), PRET offers a ready-to-deploy solution for multi-cancer diagnostics and tasks. In addition to the advantage of training-free pan-cancer recognition, PRET fully leverages the rich local information from patch tiles for the effective use of limited labeled examples, beyond existing training-free methods 16,20,21^{16,20,21}. Specifically, given a few labeled data as examples with a foundation model to extract their features, PRET learns from them during the inference phase in the manner of in-context learning (ICL) 22^{22}, without any parameter fine-tuning. Different from existing visual ICL methods for general images 23−26^{23-26} or patch titles 27^{27}, PRET fully accounts for the unique characteristics of WSIs, where multiple instances (patch images) preserve rich local information, thereby facilitating exceptional recognition capabilities. In addition to its high effectiveness, PRET is versatile, supporting multiple task types, involving cancer screening, tumor metastasis detection, cancer subtyping and tumor segmentation in WSI analysis. Moreover, it accommodates various visual prompts including slide labels, bounding boxes, rough masks and tumor masks, which cater to a range of tasks for better performance and flexible labeling budgets.

To systematically assess the clinical utility of PRET, we conducted comprehensive evaluations across 23 benchmarks from multiple countries (the USA, China and the Netherlands), hospitals, organs, races and tasks. PRET consistently outperforms existing training-free approaches, achieving significant improvements in key performance metrics. For example, PRET exceeds the existing best-performing method by an area under the curve (AUC) of 36.76% (P < 0.001) at most and achieves high performances over 97% on 15 benchmarks. Notably, it attained clinical-grade accuracy in lymph node metastasis detection on the CAMELYON16 dataset 28, reaching an AUC of 98.71% ± 0.22% and surpassing the performance of 11 pathologists (average AUC of 81.0% (P < 0.001)) with just eight WSI examples. Additionally, PRET demonstrated robust generalizability across institutions and populations, with minimal performance variations (1.32% in non-small cell lung cancer (NSCLC) between racial groups and strong results in underserved regions (AUC = 98.72% ± 0.93%). These findings underscore PRET's potential to make advanced pathological AI systems more accessible, addressing critical disparities in cancer care worldwide.