Fig. 1: Overview of the computational pathology challenge and the proposed FLEX framework.

a The WSI processing pipeline highlights variables that contribute to site-specific signatures. b Conceptual illustration of shortcut learning, where models exploit spurious correlations from site-specific signatures instead of learning task-related biological features. This leads to high performance on IND data but poor generalization to OOD data from unseen sites. c Datasets and tasks used in this study. A large multi-center TCGA cohort is used for training and cross-validation, with two independent external cohorts (CPTAC and in-house NFH dataset) for zero-shot generalization testing. We address 16 diagnostic tasks across four major cancer types, including NSCLC, BRCA, STAD, and CRC, spanning morphology, molecular biomarker, and gene mutation prediction. d The proposed FLEX workflow. Patch features are extracted using a pre-trained pathology VLM. Guided by visual and textual domain knowledge, FLEX selectively suppresses site-specific and demographic signatures while amplifying task-relevant biological information. The enhanced features are then used by a MIL model for slide-level prediction, leading to improved generalizability and fairness. Performance is evaluated using AUROC, fairness metrics, and interpretability methods (UMAP, attention maps). Schematics in panels (a, b), and the organ icons in panel (c) were created with BioRender.com.