Pre-processing matters: A segment search method for WSI classification

Jun Wang, Yufei Cui, Yu Mao, Nan Guan, Chun Jason Xue · OpenReview

Abstract

Pre-processing whole slide images (WSIs) can impact classification performance. Our study shows that using fixed hyper-parameters for pre-processing out-of-domain WSIs can significantly degrade performance. Therefore, it is critical to search domain-specific hyper-parameters during inference. However, searching for an optimal parameter set is time-consuming. To overcome this, we propose BAHOP (Similarity-based Basin Hopping), a novel approach for fast parameter tuning to enhance inference performance on out-of-domain data. The proposed BAHOP achieves 5% to 50% improvement in accuracy with $\times5$ times faster parameter searching speed on average.

Introduction

In computational pathology, Whole Slide Images (WSIs) are massive, giga-pixel files representing tissue samples. Before a Multiple Instance Learning (MIL) model can classify a slide, it must undergo pre-processing to segment tissue from the background and extract patches. A significant challenge arises from domain shift: pre-processing settings (e.g., segmentation thresholds) optimized for one center often fail when applied to data from another due to variations in staining, scanning, or preparation. While research typically focuses on model architecture, this paper demonstrates that pre-processing hyper-parameters are equally critical for out-of-domain generalization.

Methods: The BAHOP Framework

Searching for optimal pre-processing settings is computationally expensive, as each trial requires re-extracting features from thousands of patches. We introduce BAHOP, which accelerates this search through two main components:

  1. Basin Hopping (BH): The pre-processing landscape is non-convex and filled with local optima. Basin Hopping employs random "jumps" to explore the parameter space more effectively than traditional gradient-based or grid search methods.
  2. PSNR-based Similarity Gatekeeping: To avoid redundant, high-cost evaluations, we use Peak Signal-to-Noise Ratio (PSNR) as a proxy. For each new parameter set, we generate a low-resolution thumbnail of the segmented slide. If the PSNR between this thumbnail and the current best-performing one is below a certain threshold, the configuration is deemed "broken" or too dissimilar, and the expensive feature extraction step is skipped.
Visualization of the PSNR-based Basin Hopping HPO compared to traditional HPO.

Experimental Results

We evaluated BAHOP across several histopathology benchmarks, including Camelyon16/17 and TCGA subsets (NSCLC, BRCA, COAD), focusing on cross-center generalization.

Accuracy Gains

Optimizing pre-processing parameters led to substantial performance boosts. For instance, on the Camelyon17 dataset, accuracy for the CLAM model improved from 0.512 to 0.847. Across all datasets, we observed accuracy improvements ranging from 5% to 50% compared to using default in-domain parameters.

Accuracy improvements across various datasets comparing default vs. optimal hyper-parameters.

Efficiency and Resource Savings

BAHOP is approximately 5x faster than traditional hyper-parameter optimization (HPO) methods. By skipping unnecessary feature extractions, it also significantly reduces storage and memory requirements. In one test case, disk usage dropped from 1250GB to 170GB.

Conclusion

Pre-processing is not a "set it and forget it" step; it is a tunable variable essential for model robustness. BAHOP provides a fast, efficient way to adapt models to new domains by optimizing segmentation thresholds. Future work will explore expanding the search space to include color normalization and augmentation parameters, further enhancing the "zero-shot" deployment capabilities of pathology foundation models.

Summary updated

BibTeX
@misc{wang2024pre,
  author = {Jun Wang and Yufei Cui and Yu Mao and Nan Guan and Chun Jason Xue},
  title = {{Pre-processing matters: A segment search method for WSI classification}},
  year = {2024},
  eprint = {2404.11161},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.11161},
}
Figure