Source-linked AI summary

AtlasPatch: Efficient Tissue Detection and High-throughput Patch Extraction for Computational Pathology at Scale

Ahmed Alagha, Christopher Leclerc, Yousef Kotp, Omar Metwally, Calvin Moras, Peter Rentopoulos, Ghodsiyeh Rostami, Bich Ngoc Nguyen, Jumanah Baig, Abdelhakim Khellaf, Vincent Quoc-Huy Trinh, Rabeb Mizouni, Hadi Otrok, Jamal Bentahar, Mahdi S. Hosseini

arXiv:2602.03998v2eess.IVcs.CVq-bio.QM

TL;DR

WSI preprocessing is a major scaling bottleneck because large and heterogeneous pathology cohorts require tissue detection and patch extraction at high throughput. AtlasPatch uses thumbnail-based SAM2 tissue detection with parallelized contour and coordinate processing. It achieves comparable slide-level performance while substantially reducing runtime, including a reported 16× speed advantage over a Trident variant.

  • Problem

    WSI preprocessing must handle large slides and foundation-model-scale patch volumes, but standard workflows become increasingly expensive to scale.

  • Method

    AtlasPatch detects tissue at low resolution, extrapolates contours to target magnifications, and parallelizes patch-coordinate extraction and processing.

  • Results

    16× faster than Trident- in end-to-end runtime while achieving slide-level performance comparable to strong baselines across diverse MIL tasks.

  • Takeaways & Limitations

    AtlasPatch provides a computationally efficient preprocessing backbone for foundation-model-scale pathology workflows.

  • Takeaways & Limitations

    Manual annotation remains a limitation, and AtlasPatch does not always reproduce every fine-grained internal hole within tissue regions.

Abstract

from arXiv · show

Whole-slide image (WSI) preprocessing, comprising tissue detection followed by patch extraction, is foundational to AI-driven computational pathology but remains a major bottleneck for scaling to large and heterogeneous cohorts. We present AtlasPatch, a scalable framework that couples foundation-model tissue detection with high-throughput patch extraction at minimal computational overhead. Our tissue detector achieves high precision (0.986) and remains robust across varying tissue conditions (e.g., brightness, fragmentation, boundary definition, tissue heterogeneity) and common artifacts (e.g., pen/ink markings, scanner streaks). This robustness is enabled by our annotated, heterogeneous multi-cohort training set of ~30,000 WSI thumbnails combined with efficient adaptation of the Segment-Anything (SAM) model. AtlasPatch also reduces end-to-end WSI preprocessing time by up to 16$\times$ versus widely used deep-learning pipelines, without degrading downstream task performance. The AtlasPatch tool is open-source, efficiently parallelized for practical deployment, and supports options to save extracted patches or stream them into common feature-extraction models for on-the-fly embedding, making it adaptable to both pathology departments (tissue detection and quality control) and AI researchers (dataset creation and model training). AtlasPatch software package is available at https://github.com/AtlasAnalyticsLab/AtlasPatch.

1 Introduction

AtlasPatch targets the cost and scalability bottlenecks of WSI preprocessing by combining robust thumbnail-level tissue detection with parallelized, high-throughput patch extraction. Across heterogeneous cohorts and downstream tasks, it preserves performance while reducing preprocessing overhead.

  • Motivation: WSI preprocessing constrains the pace, cost, and reach of computational pathology as foundation models demand billions of diverse tissue patches.Large slides contain substantial non-tissue background, making naïve tiling produce millions of candidate patches.
  • Limitations of existing pipelines: Existing thresholding methods require manual tuning and can fail under stain or tissue variation, whereas patch-wise deep-learning pipelines scale poorly.Patch-wise approaches may require hundreds to thousands of forward passes per WSI.
  • Detection robustness: AtlasPatch produces clean thumbnail-level masks that suppress artifacts and generalize across illumination, fragmentation, heterogeneity, and boundary-definition changes.The paper reports that thumbnail-based detection is sufficient for downstream MIL without measurable loss.
  • AtlasPatch design: AtlasPatch combines tissue detection, patch-coordinate extraction, optional patch embedding, and patch export in a modular Python pipeline.The system parallelizes thumbnail inference, coordinate generation, and patch I/O across GPUs and multicore CPUs.
  • AtlasPatch design: The method adapts SAM2 by fine-tuning only normalization layers on a heterogeneous multi-cohort corpus with structured thumbnail-mask annotation.The corpus spans organs, institutions, scanners, and tissue conditions, while freezing the backbone reduces training memory and time.
  • Evaluation: Across kidney, lung, breast, and colorectal classification tasks, AtlasPatch-derived patches achieve comparable or sometimes higher MIL performance while reducing runtime by up to 16-fold.The pipeline is presented as a computationally efficient backbone for foundation-model-scale pathology workflows.

2 Results

AtlasPatch combines heterogeneous multi-cohort thumbnail annotation with efficient SAM2 adaptation for robust tissue detection and high-throughput preprocessing. It preserves tissue across challenging conditions while reducing segmentation runtime relative to patch-based alternatives.

  • Curated multi-cohort thumbnail dataset: ~36,000 WSI thumbnails span four centers, multiple organs, scanners, acquisition settings, and predominantly H&E with a small IHC subset.The corpus captures variation in tissue coverage, fragmentation, boundary definition, brightness, hue heterogeneity, and colorfulness.
  • AtlasPatch pipeline: Thumbnail-based AtlasPatch processing detects tissue with finetuned SAM2, extrapolates contours to high resolution, and computes coordinates for patch export or feature embeddings.The model adapts SAM2 by finetuning normalization layers, reducing training memory and time.
  • Curated multi-cohort thumbnail dataset: Semi-manual Labelbox annotation with iterative quality control produced dense tissue–background supervision for SAM2 finetuning and evaluation.Annotators refined automated masks or drew tissue masks directly, with ambiguous cases returned for revision and annotations vetted by a board-certified pathologist.
  • Tissue detection robustness: AtlasPatch accurately segments contiguous and fragmented tissue across cohorts while largely excluding artifacts and non-tissue structures.Held-out examples show robust behavior under low contrast, tissue heterogeneity, scanner or preparation artifacts, and many small tissue islands.
  • Tissue detection robustness: 0.986 precision slightly exceeds Trident-Hest at 0.983, dplabtools at 0.977, and HistoQC at 0.985.Thresholding methods often miss tissue or confuse artifacts with tissue, while AtlasPatch remains consistent across the tested scenarios.
  • Computational efficiency: 2.6× faster than Trident-GrandQC and 20× faster than Trident-Hest, AtlasPatch achieves high performance with lower wall-clock time than patch-wise detectors.Patch-based deep models incur higher runtime because they process up to thousands of patches per slide.
  • Robustness analysis: 1.9% machine-stratified and 0.71% brightness-stratified precision ranges show stable performance when training uses heterogeneous data.Narrow training sets produced precision drops up to 13.5% for machine and 44.4% for tissue percentage, supporting the heterogeneous training design.
  • Ablation and backbone analysis: 0.984-0.989 precision and 0.985-0.988 F1 across tested settings indicate robustness to reasonable hyperparameter choices.The best overall trade-off uses 1024×1024 thumbnails and batch size 2; larger backbones provide marginal gains with substantial overhead.

2.6 Performance on Downstream Tasks

AtlasPatch-derived patches support competitive slide-level prediction across six MIL tasks while producing fewer embeddings and requiring substantially less preprocessing time. Its downstream efficiency reflects focused patch selection without a broad performance loss.

  • Evaluation design: Six downstream MIL tasks evaluate AtlasPatch against CLAM, Trident-Hest, and Trident-GrandQC using slide-level metrics, patch counts, and runtime.The tasks cover cancer invasiveness, dysplasia, breast and renal subtyping, lung carcinoma classification, and prostate grading.
  • Downstream performance: Across six tasks, AtlasPatch patches achieve slide-level performance effectively on par with the best competing pipelines.The comparison uses multiple MIL methods trained on patches extracted separately by each preprocessing tool.
  • Downstream performance: 98.6% invasiveness and 96.6% dysplasia accuracy remain within at most 0.2% of the highest-performing pipeline.AtlasPatch also achieves 73.5%, 95.8%, and 97.7% accuracy on three reported classification tasks.
  • Downstream performance: 93.7% BRCA accuracy compares with 94.4% for CLAM while using nearly one third as many patches per WSI.The lower patch count reflects reduced background in the extracted representation.
  • Patch and computational complexity: ∼3075 patches per WSI versus ∼8976 for CLAM, ∼3093 for Trident-Hest, and ∼3204 for Trident-GrandQC reduces downstream representation size.The extracted patches are described as more focused and information-dense, with less redundant background.
  • Patch and computational complexity: 195.51 seconds processes 100 slides, making AtlasPatch more than 2× faster than CLAM and Trident-GrandQC and more than 16× faster than Trident-Hest.Runtime measures patch-coordinate extraction including tissue detection under the same computational infrastructure.

3 Discussion

AtlasPatch addresses the computational and operational bottlenecks of WSI preprocessing with thumbnail-based tissue detection, modular patch extraction, and efficient parallel execution. Its masks remain robust across challenging tissue conditions and artifacts, while preprocessing is faster without degrading downstream task performance.

  • Method: AtlasPatch detects tissue at low resolution and extrapolates contours to generate patch coordinates at requested magnifications or patch sizes.This thumbnail-based design avoids repeated high-resolution reads and patch-level inference.
  • Robustness: AtlasPatch produced consistent masks under low contrast, heavy fragmentation, and common artifacts, although it did not always reproduce fine-grained internal tissue holes.The detector retained the full spatial footprint of diagnostically meaningful tissue and avoided large false negatives.
  • Robustness: AtlasPatch combines a heterogeneous training dataset with parameter-efficient SAM2 adaptation to improve robustness without heavy training or deployment overhead.The approach is contrasted with patch-level deep segmenters that require dense scanning and stitching.
  • Efficiency and downstream performance: Up to 16× lower runtime was achieved while AtlasPatch-derived patches retained slide-level performance comparable to strong baselines across diverse MIL tasks.The focused tissue search space also reduces redundant downstream processing.
  • Practical deployment: AtlasPatch provides modular checkpoints, standardized outputs, resumable execution, and optional patch export or on-the-fly embedding for researchers and pathologists.Wider adoption would benefit from pathologist-friendly GUI components and tighter integration with slide viewers and QC tools.
  • Motivation: WSI preprocessing can become a dominant computational constraint as pathology scales toward foundation-model datasets and increasingly large cohorts.Repeated patch extraction requires substantial runtime, I/O, and computation at scale.

4 Methods

AtlasPatch trains a tissue detector on a heterogeneous, annotated WSI-thumbnail corpus and adapts SAM2 with efficient fine-tuning. The pipeline is designed for high-throughput segmentation across variable clinical imaging conditions.

  • Dataset construction: The corpus combines slides from multiple datasets, institutions, scanners, magnifications, and predominantly H&E staining with a small IHC subset.
  • Dataset characterization: Natural laboratory and scanner variability was retained by applying no stain normalization or color augmentation during thumbnail preparation.
  • Dataset construction: Thumbnail masks were created semi-manually with multiscale box-based annotation, boundary refinement, artifact removal, and senior quality-control review.
  • Dataset construction: Approximately 30,000 thumbnail–mask pairs span varying organs, cohorts, and acquisition conditions.
  • Dataset characterization: Slide diversity was quantified using tissue coverage, object count, boundary definition, brightness, heterogeneity, and colorfulness statistics, with bins used for stratified testing.
  • Tissue detection via SAM2: SAM2 is used in an image-only setting for independent WSI thumbnails, without its memory bank or temporal propagation.
  • Tissue detection via SAM2: AtlasPatch selects SAM2 for its larger-scale pretraining and 6× faster inference, using the Hiera encoder for high-throughput thumbnail segmentation.
  • Tissue detection via SAM2: Efficient adaptation updates only normalization-layer affine parameters while freezing the backbone, supporting stable domain adaptation.

5 Data Availability

AtlasPatch combines public datasets with in-house CHUM cohorts, while access to the latter is constrained by institutional approvals and data-sharing agreements.

  • Public sources include TCGA data from the GDC platform, CAME-LYON17 from Grand Challenge, and PANDA from Kaggle.
  • In-house CHUM pancreas and digestive-system cohorts were used under institutional approvals and data-sharing agreements and are not publicly available.

6 Code Availability

AtlasPatch provides open-source code and a hosted tissue-detection checkpoint, with authenticated model retrieval and a non-commercial-use restriction.

  • AtlasPatch is open-sourced, and its trained tissue-detection checkpoint is hosted on Hugging Face.
  • Users must provide a valid Hugging Face access token to retrieve the model weights.
  • Commercial use of the software is not permitted.
Loading 2602.03998v2…