Papers
Topics
Authors
Recent
Search
2000 character limit reached

AtlasPatch: WSI Preprocessing & 3D Reconstruction

Updated 28 April 2026
  • AtlasPatch is a dual-purpose framework for computational pathology and 3D geometry that employs efficient preprocessing and atlas-of-patches representation to optimize data fidelity.
  • In pathology, it uses a refined tissue detection network and vectorized patch extraction to achieve high Dice and IoU scores with significantly reduced computational costs.
  • In 3D reconstruction, AtlasPatch leverages overlapping parametric patch maps with loss-regularized normal consistency and stitching to yield seamless, high-fidelity surfaces.

AtlasPatch refers to two distinct but technically related frameworks in computational science: (1) a state-of-the-art, high-throughput preprocessing toolkit for whole slide images (WSIs) in computational pathology, and (2) an "atlas-of-patches" representation for 3D surface reconstruction, primarily discussed in geometric deep learning. Computational efficiency, modular design, and fidelity in data representation underpin both frameworks. The term "AtlasPatch" thus signifies either a specialized WSI preprocessing pipeline or a methodology for constructing global geometric objects from local parametric patches, with rigorous technical workflow and mathematically-justified optimizations.

1. AtlasPatch in Computational Pathology

AtlasPatch provides efficient and scalable preprocessing for whole slide images—critical for AI-driven digital pathology. The workflow comprises robust tissue detection followed by high-throughput patch extraction, overcoming bottlenecks in existing approaches that either suffer from poor tissue localization (heuristic thresholding) or excessive computational overhead (patch-wise AI models trained on narrow data distributions) (Alagha et al., 3 Feb 2026).

Architecture and Workflow

  • Tissue Detection: Utilizes a domain-adapted SAM2-Hiera tiny network (38.9M parameters, LayerNorm fine-tuning of only 0.076% of parameters), with single bounding-box prompting on thumbnails (typically 1024×1024 pixels).
  • Training Data: The tissue detection module is trained on ~30,000 high-quality, semi-manually annotated thumbnail–mask pairs, curated from 35,827 WSIs across six major datasets (CHUM, TCGA, Camelyon17, PANDA, Radboud, Karolinska).
  • Inference: Achieves tissue masks via a single forward pass per slide, with no tiling.
  • Mask Extrapolation: Predicted thumbnail masks MthumbM_{\text{thumb}} are scaled to full-resolution masks MfullM_{\text{full}} via:

Mfull(x,y)=Mthumb(x/s,y/s)M_{\text{full}}(x, y) = M_{\text{thumb}}(\lfloor x/s \rfloor, \lfloor y/s \rfloor)

where ss is the level-0 to thumbnail scale factor. Polygonal contour vectorization enables O(Ci)O(\sum |C_i|) complexity rather than naive O(s2hw)O(s^2 h w) upsampling.

  • Patch Extraction: User-configurable parameters—patch size pp, magnification mm, overlap oo, tissue-area threshold θ\theta. Efficiently tiles candidate patch centers within mask contours, filters by tissue content, and outputs coordinate arrays (HDF5 "bags").
  • Parallelization: Pipeline includes CPU multithreading for I/O-bound steps and GPU batching for segmentation and patch embedding. Resumability is enforced via per-slide lockfiles.

Key Algorithms and Computational Complexity

Step Complexity Parallelization
Mask upsampling (naive) MfullM_{\text{full}}0 N/A
Mask upsampling (vectorized) MfullM_{\text{full}}1 CPU threads
Patch coord. gen. MfullM_{\text{full}}2 Each slide in parallel
Segmentation MfullM_{\text{full}}3 per thumbnail (forward pass) Batched on GPU

The segmentation results (Dice = 0.987, IoU = 0.975 on 3,000 held-out slides) match or exceed other leading tools (Trident-Hest, dplabtools, HistoQC) while yielding up to MfullM_{\text{full}}4 reduction in preprocessing runtime and using MfullM_{\text{full}}5–MfullM_{\text{full}}6 fewer patches in downstream multiple-instance learning benchmarks (Alagha et al., 3 Feb 2026).

2. AtlasPatch Representation in Surface Reconstruction

In 3D geometry, "AtlasPatch" denotes an atlas-of-patches approach where a surface is reconstructed from MfullM_{\text{full}}7 overlapping parametric patches. Each patch MfullM_{\text{full}}8 maps a 2D domain MfullM_{\text{full}}9 through a learned function Mfull(x,y)=Mthumb(x/s,y/s)M_{\text{full}}(x, y) = M_{\text{thumb}}(\lfloor x/s \rfloor, \lfloor y/s \rfloor)0, parameterized by an MLP. The global surface is the union Mfull(x,y)=Mthumb(x/s,y/s)M_{\text{full}}(x, y) = M_{\text{thumb}}(\lfloor x/s \rfloor, \lfloor y/s \rfloor)1, with Mfull(x,y)=Mthumb(x/s,y/s)M_{\text{full}}(x, y) = M_{\text{thumb}}(\lfloor x/s \rfloor, \lfloor y/s \rfloor)2 a shape code from an encoder (Deng et al., 2020).

Patch Stitching and Global Consistency

A core challenge is that patchwise maps may not align at the seams, producing holes or visual artifacts. AtlasPatch frameworks address this via loss functions:

  • Normal Consistency Loss Mfull(x,y)=Mthumb(x/s,y/s)M_{\text{full}}(x, y) = M_{\text{thumb}}(\lfloor x/s \rfloor, \lfloor y/s \rfloor)3: Enforces Mfull(x,y)=Mthumb(x/s,y/s)M_{\text{full}}(x, y) = M_{\text{thumb}}(\lfloor x/s \rfloor, \lfloor y/s \rfloor)4-like continuity by aligning patch-local normals and global normals computed via neighborhood PCA. For each output point Mfull(x,y)=Mthumb(x/s,y/s)M_{\text{full}}(x, y) = M_{\text{thumb}}(\lfloor x/s \rfloor, \lfloor y/s \rfloor)5:

Mfull(x,y)=Mthumb(x/s,y/s)M_{\text{full}}(x, y) = M_{\text{thumb}}(\lfloor x/s \rfloor, \lfloor y/s \rfloor)6

  • Stitching Error Loss Mfull(x,y)=Mthumb(x/s,y/s)M_{\text{full}}(x, y) = M_{\text{thumb}}(\lfloor x/s \rfloor, \lfloor y/s \rfloor)7: Margin points sampled near patch boundaries are pulled toward their nearest neighbors from other patches, minimizing boundary gaps:

Mfull(x,y)=Mthumb(x/s,y/s)M_{\text{full}}(x, y) = M_{\text{thumb}}(\lfloor x/s \rfloor, \lfloor y/s \rfloor)8

These terms, added post-pretraining, do not change network capacity but yield near seam-free, high-fidelity surfaces. Empirical benchmarks on ShapeNet (e.g., "plane" category, mean normal error Mfull(x,y)=Mthumb(x/s,y/s)M_{\text{full}}(x, y) = M_{\text{thumb}}(\lfloor x/s \rfloor, \lfloor y/s \rfloor)9, stitching metric ss0 for full method) verify improvement over AtlasNet/DSP, with minor trade-off in Chamfer Distance (Deng et al., 2020).

3. Data Curation and Annotation

For the pathology pipeline, diverse data were curated from clinical and public sources:

  • Sources: 35,827 WSIs spanning multiple organs and institutions.
  • Annotation Pipeline: Semi-manual labeling using AutoSegmentBox and Pen refinements in Labelbox; three expert annotators and QC by a board-certified pathologist.
  • Diversity Metrics: Slide-level statistics include tissue coverage, object (fragmentation) count, boundary contrast (Michelson), brightness, hue entropy, and colorfulness, ensuring model generalizability (Alagha et al., 3 Feb 2026).

In surface reconstruction, ShapeNet Core v2 serves as the standard benchmark, with patches and margin points sampled to robustly penalize both interior and boundary inconsistencies.

4. Implementation, Usage, and Performance

Pathology Toolkit

  • Codebase: Modular Python, GPU/CPU parallelized. Organized into modules for tissue detection (detect.py), coordinate extraction (extract.py), patch embedding (embed.py), and export (export.py).
  • Command Line Interface: Provides --mode argument (detect, extract, embed, export) and supports batch processing, HPC integration, and idempotent resumability.
  • Installation: Python 3.8+, PyTorch ≥2.0 with CUDA, OpenSlide-Python, torchvision, h5py, shapely, tqdm. Installable via pip.

Example CLI and Python usage: ss8

AtlasPatch Surface Network

  • Encoder: PointNet or ResNet-18, producing global shape code.
  • Decoder: ss1 MLPs, 4 layers, Softplus activations.
  • Training: Pretrain with Chamfer/laplacian losses; finetune with ss2 and ss3 (weights ss4), Adam optimizer, margin ss5, neighbor count ss6 or 8, angle ss7.
  • Output: Learned patch MLPs for inference; pseudocode is provided in (Deng et al., 2020).

5. Benchmarks and Comparative Analysis

Whole Slide Pathology

Method Precision Recall F1 IoU Segmentation Speed (100 WSIs)
AtlasPatch 0.986 0.988 0.987 0.975 20 s
Trident-Hest 0.983 0.989 0.986 0.973 400 s
Trident-GrandQC - - - - 52 s
dplabtools 0.977 0.964 0.970 0.947 -
HistoQC 0.985 0.936 0.960 0.925 -

In downstream multiple-instance learning, six tasks across eight MIL architectures show AtlasPatch achieves competitive or superior classification accuracy with 2–3x fewer patches and up to 16x lower preprocessing time, compared to CLAM, Trident-GrandQC, and Trident-Hest (see (Alagha et al., 3 Feb 2026) for details).

Surface Reconstruction

AtlasPatch with normal and stitching losses consistently improves surface continuity and appearance versus baseline DSP (see section 6 in (Deng et al., 2020)), with only a marginal increase in Chamfer Distance.

6. Innovations, Utility, and Limitations

  • Thumbnail-based fine-tuning of a foundation model (SAM2) for tissue detection provides robust segmentation, even under high WSI diversity.
  • Polygonal contour upsampling circumvents patch-wise segmentation, reducing computational cost.
  • Modular, lockfile-secured design supports highly parallel, large-scale workflows (e.g., for billion-patch datasets or foundation-model training).
  • Limitation in surface reconstruction: stitching loss does not guarantee closure of very large holes if they exceed the margin radius; neighbor search incurs computational overhead; future work could involve differentiable rendering or dynamic patch allocation (Deng et al., 2020).
  • A plausible implication is that efficient, fully vectorized preprocessing as in AtlasPatch enables practical curation and embedding of massive histopathology corpora, and that loss-regularized stitching translates to improved global consistency in learned geometric representations.

Atlas-based patching is a unifying motif across both high-throughput digital pathology and surface geometry, building on chart-based decomposition in manifold theory and recent advances in deep neural parametric mapping. In digital pathology, further improvements could derive from cross-domain transfer of segmentation backbones and richer annotation strategies, while for 3D surfaces, integration with differentiable rendering and adaptive patch allocation could overcome current connectivity or efficiency limitations (Alagha et al., 3 Feb 2026, Deng et al., 2020).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to AtlasPatch.