arXiv:2610.10225cs.CVOct 2026

Manuscript Offprint

arXiv:2610.10225

Masked Feature Encoding for Large-Scale Whole Slide Image Representation

Haoyu He, Basile Tessier-Cloutier, Yang Wang, Mahdi S. Hosseini

Haoyu He 1^{1}, Basile Tessier-Cloutier 3^{3}, Yang Wang 1,2^{1,2}, and Mahdi S. Hosseini 1,2,3^{1,2,3}

1^{1} Department of Computer Science and Software Engineering (CSSE), Concordia University, Montreal, Canada

h_haoy@live.concordia.ca, yang.wang@concordia.ca,

mahdi.hosseini@concordia.ca

2^{2} Mila – Quebec AI Institute, Montreal, Canada

3^{3} McGill University, Montreal, Canada

basile.tessiercloutier@mcgill.ca

Abstract. Whole slide image (WSI) analysis in computational pathology follows a multiple instance learning (MIL) pipeline where patch embeddings are extracted independently and aggregated for slide-level prediction, but within-slide variance from staining, scanner, and local texture can overwhelm the discriminative signal. We propose Masked Feature Encoding for Multiple Instance Learning (MFE-MIL), a feature-space masking framework that trains a lightweight MLP adapter jointly with a window-based masked reconstruction branch and a MIL classification head. The two objectives are complementary. Classification guides the adapter to suppress within-slide patch variance, while window-based masked reconstruction provides an auxiliary regularizer for the adapted features without using patch coordinates, coordinate graphs, or segmentation preprocessing. The raster patch-extraction order is used only as a weak implicit prior. At inference, the decoder is removed, leaving only the adapter and MIL head. Across CAMELYON16/17, PANDA, and TCGA-BRCA with four diverse encoders, MFE-MIL improves ACC/F1 for nearly all tested aggregator-encoder settings and AUC in most, outperforms coordinate-based spatial methods (CAMIL), and achieves higher AUC than 2DMamba on three of four datasets (UNI). On five TCGA survival cohorts it improves the average concordance index for every aggregator tested, its most consistent gain. Code is available at https://github.com/AtlasAnalyticsLab/MFE-MIL.

1 Introduction

In computational pathology (CPath) [8,15,29], Whole Slide Image (WSI) classification is typically achieved through Multiple Instance Learning (MIL) [24,31], where a frozen encoder extracts patch-level embeddings, and an aggregator combines them into a slide-level prediction. Most MIL methods treat patches as an unordered set, so each embedding is computed in isolation and carries within-slide variation (staining, scanner, local texture) that can mask the diagnostic signal (Fig. 1).

H. He et al.

Figure

Fig. 1: Top: Standard MIL aggregates independently embedded patches whose features carry high within-slide variance. Bottom: MFE-MIL adapts the patch features and regularizes them with masked reconstruction over neighbouring packed features, giving a more discriminative slide-level representation.

Recent spatially aware MIL methods try to close this gap by incorporating explicit structural priors such as coordinate grids, topology graphs, or segmentation masks [11, 12, 32, 37], but require tight encoder-aggregator coupling that reduces compatibility with standard frozen-feature pipelines. We propose MFE-MIL, built on the hypothesis that high within-slide variance in independently computed patch embeddings, rather than missing spatial priors, limits MIL aggregators. An architecture-agnostic MLP adapter, jointly trained with MIL classification and a window-based masked reconstruction objective, learns slide-coherent representations: the MIL classification objective drives the adapter to suppress within-slide patch variance, while the window MFE pretext task acts as an auxiliary reconstruction regularizer on the compressed space, giving all aggregators a cleaner discriminative signal (Fig. 2). Unlike MAE-based CPath approaches, the reconstruction acts at fine-tuning time rather than during backbone pretraining (Sec. 2).

References (38)