Towards Effective and Efficient Context-aware Nucleus Detection in Histopathology Whole Slide Images

Zhongyi Shui, Ruizhe Guo, Honglin Li, Yuxuan Sun, Yunlong Zhang, Chenglu Zhu, Jiatong Cai, Pingyi Chen, Yanzhou Su, Lin YangarXiv 2025 · OpenReview

Abstract

Nucleus detection in histopathology whole slide images (WSIs) is crucial for a broad spectrum of clinical applications. The gigapixel size of WSIs necessitates the use of sliding window methodology for nucleus detection. However, mainstream methods process each sliding window independently, which overlooks broader contextual information and easily leads to inaccurate predictions. To address this limitation, recent studies additionally crop a large Filed-of-View (LFoV) patch centered on each sliding window to extract contextual features. However, such methods substantially increase whole-slide inference latency. In this work, we propose an effective and efficient context-aware nucleus detection approach. Specifically, instead of using LFoV patches, we aggregate contextual clues from off-the-shelf features of historically visited sliding windows, which greatly enhances the inference efficiency. Moreover, compared to LFoV patches used in previous works, the sliding window patches have higher magnification and provide finer-grained tissue details, thereby enhancing the classification accuracy. To develop the proposed context-aware model, we utilize annotated patches along with their surrounding unlabeled patches for training. Beyond exploiting high-level tissue context from these surrounding regions, we design a post-training strategy that leverages abundant unlabeled nucleus samples within them to enhance the model's context adaptability. Extensive experimental results on three challenging benchmarks demonstrate the superiority of our method.

Introduction: The Context Gap in Digital Pathology

Whole Slide Images (WSIs) in digital pathology are massive, often exceeding billions of pixels. Due to hardware constraints, these images are typically analyzed using a "sliding window" approach, where the image is partitioned into small, manageable patches. However, this method introduces a significant limitation: it isolates individual cells from their surrounding tissue environment.

Comparison between mainstream sliding window methods and context-aware pathologist analysis.

A nucleus detector operating on a tiny patch lacks the "big picture" context that human pathologists rely on. For instance, a cell's clinical significance—whether it is a tumor cell or a benign background cell—often depends on its location within a larger structure, such as a tumor nest or a stromal region. As shown in Figure 1, mainstream methods often misclassify cells when restricted to a small Field-of-View (FoV). While previous attempts to solve this involved cropping a second, larger FoV (LFoV) for every patch, this approach doubles data processing time and significantly slows down clinical workflows.

The PathContext Framework

To bridge the gap between efficiency and accuracy, we introduce PathContext, a framework designed for effective and efficient context-aware nucleus detection. PathContext is built upon two primary pillars: efficiency through feature reuse and adaptability through semi-supervised learning.

1. Context Aggregation via Feature Reuse

Rather than performing redundant image cropping and encoding for LFoV patches, PathContext reuses "off-the-shelf" features from neighboring sliding windows that have already been processed. By utilizing a shared visual encoder (ResNet-50) for both the target patch and its neighbors, the model integrates these features using a cross-attention mechanism. This allows the detector to "consult" the surrounding neighborhood without the computational overhead of processing additional high-resolution data.

2. Selective Gradient Computation

Processing multiple patches simultaneously (the target plus eight neighbors) can lead to excessive GPU memory consumption. To mitigate this, PathContext employs selective gradient computation during training. The model performs backpropagation on only a random subset of neighboring patches, while the remaining neighbors undergo a simple forward pass, maintaining a manageable memory footprint.

3. Morphology-rich Embedding (ME)

One challenge in context-aware models is that high-level tissue context can sometimes "dilute" the model's focus on fine-grained nuclear details, such as texture and shape. PathContext addresses this by incorporating an auxiliary Morphology-rich Embedding (ME) branch, which ensures that critical morphological features are preserved alongside contextual information.

4. Cross-Labeling Strategy

To further enhance adaptability, we leverage the thousands of unlabeled nuclei present in surrounding patches. Using a separate, lightweight segmentation model, we generate "pseudo-labels" for these nuclei. This allows the main detector to practice classifying cells across diverse contexts during a post-training phase, reducing the risk of confirmation bias.

Experimental Results

PathContext was evaluated on three challenging benchmarks: BRCA (breast cancer), OCELOT (multi-organ), and PUMA (melanoma). The results demonstrate a significant leap in both performance and speed:

  • State-of-the-Art Accuracy: PathContext outperformed leading methods like Hover-Net and P2PNet, showing F1-score improvements of 3.61 points on BRCA, 1.74 on OCELOT, and 2.75 on PUMA.
  • Inference Efficiency: Compared to the previous leading context-aware method (MFoV-P2PNet), PathContext achieved a 2.36× speedup during inference, making it far more suitable for high-throughput clinical environments.
  • Segmentation Quality: In instance segmentation tasks, the framework improved Panoptic Quality (PQ) by up to 3.03 points across the datasets.

Conclusion

PathContext provides a robust solution for nucleus detection by effectively balancing the need for tissue context with the requirement for computational efficiency. By reusing existing features and leveraging unlabeled data through a cross-labeling strategy, the framework achieves superior accuracy without the latency penalties of traditional multi-scale approaches. Future work will focus on optimizing training times through feature caching and testing the model's generalizability across a wider variety of rare pathologies.

Summary updated

BibTeX
@misc{shui2025towards,
  author = {Zhongyi Shui and Ruizhe Guo and Honglin Li and Yuxuan Sun and Yunlong Zhang and Chenglu Zhu and Jiatong Cai and Pingyi Chen and Yanzhou Su and Lin Yang},
  title = {{Towards Effective and Efficient Context-aware Nucleus Detection in Histopathology Whole Slide Images}},
  year = {2025},
  eprint = {2503.05678},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.05678},
}
Figure