- The paper introduces a cluster-first paradigm that couples deep segmentation (Cellpose-SAM) with unsupervised clustering (DBSCAN) to streamline histology image annotation.
- It demonstrates high cluster-label alignment accuracy—with up to 100% agreement in several tissue types—across 13 tissue types and 3 species.
- The pipeline’s containerized, scalable design reduces manual annotations from O(N) to O(K), significantly enhancing efficiency.
Cluster-First Labelling for Automated Segmentation and Morphological Clustering in Histology WSIs
Introduction
Manual annotation of histology whole slide images (WSIs) at the cellular or subcellular level is a primary bottleneck in computational pathology, given the intensive labor required to segment and classify tens of thousands of structures per slide. The paper "Cluster-First Labelling: An Automated Pipeline for Segmentation and Morphological Clustering in Histology Whole Slide Images" (2604.09370) proposes an automated end-to-end workflow that significantly reduces human annotation effort by leveraging a "cluster-first" paradigm. This approach couples state-of-the-art deep segmentation with unsupervised feature-based clustering, allowing human annotators to operate at the cluster level rather than individual objects. The pipeline's generality is validated across 13 tissue types and three species, and a dedicated human-in-the-loop web interface quantitatively benchmarks cluster-label alignment.
Pipeline Architecture
The pipeline consists of modular, containerized stages orchestrated for cloud scalability, enabling parallel execution per slide and supporting GPU acceleration throughout.

Figure 1: The pipeline tiles WSIs into 512Ă—512 patches, filters for quality, segments with Cellpose-SAM, embeds with ResNet-50, reduces with UMAP, clusters via DBSCAN, and optionally annotates or classifies using a multimodal LLM.
WSIs Tiling and Quality Filtering
Slides are partitioned into fixed-size tiles. Multiple image quality metrics (edge density, brightness, color variance, focus, etc.) are evaluated per tile, and those failing thresholds are excluded to conserve downstream compute.
Segmentation
Cellpose-SAM serves as the backbone for instance segmentation. Its gradient-flow representation, augmented by a Segment Anything encoder, affords broad generalization—detecting not just individual cells but diverse cell-like and tissue-like structures. Key segmentation parameters are exposed for per-dataset tuning but were kept fixed for cross-tissue evaluation.
Feature Extraction and Clustering
Each segmented object is cropped and mapped to a 2048-dim feature embedding via a pretrained ResNet-50. Dimensionality is optionally compressed with UMAP to retain local structure in a compact space. DBSCAN is employed for density-based clustering of the embeddings, eliminating the need to prespecify the number of morphological groups. Model parameters such as ε and min_samples are automatically selected or set globally across all tissue types tested.
Scalability and Containerization
Execution is orchestrated via Azure ML, supporting both sequential (debug) and parallel (production) runs. Each slide can be processed independently on a separate GPU node, enabling rapid scaling to large cohorts.
Human Annotation and Evaluation Framework
A custom web interface facilitates efficient expert labeling at scale.

Figure 2: Labelling interface enables per-tile and cluster-level validation with polygonal overlays, label assignment, and batch progress tracking.
Critically, the accuracy of unsupervised clusters is quantitatively benchmarked using Hungarian-aligned accuracy: contingency matrices are constructed per tile to measure optimal one-to-one mapping between model clusters and human assigned labels, maximizing assignment fidelity independent of arbitrary cluster or label IDs.
Empirical Results
Dataset and Protocol
The pipeline was evaluated using 3,696 segmented objects (cells and similar structures) across 13 tissue types (human, rat, rabbit), with three species represented. No tissue-specific tuning was performed; all configuration parameters were held constant across the dataset.
Batch-Level and Tissue-Level Alignment
Strong quantitative outcomes are reported:
- Weighted cluster–label alignment accuracy: 96.8%
- Perfect (100%) agreement for 7 out of 13 tissue types; ≥99% for 9 types
- Lowest performance observed for "compact bone" and "skeletal muscle" (84%), attributed to the inherent morphological variability and low object count per tile in these tissues
Representative confusion matrices from the evaluation interface illustrate consistently high diagonal occupancy, indicative of robust alignment between unsupervised clustering and expert assessment.

Figure 3: Evaluation dashboard, with per-tile confusion matrices comparing human and model clusters; diagonal dominance signals strong alignment.
Tile-level overlays further demonstrate qualitative agreement, with minimal mismatches present in challenging tissue types.

Figure 4: Post-alignment overlays highlight correspondence between human labels and cluster IDs; shown for a rabbit femur tile with 99.5% accuracy.
Analysis of Failure Modes
Performance degradation in compact bone and skeletal muscle is attributed to two phenomena:
- Low cell count per tile in bone leads to unreliable density estimation for DBSCAN.
- Diverse morphologies in muscle, where spatial context unavailable to the model is critical for distinguishing object types.
In both cases, object-centric representation without broader spatial cues can result in morphologically or functionally distinct entities being grouped together.
Practical and Theoretical Implications
Annotation Efficiency
The cluster-first paradigm reduces direct annotation requirements from O(N) (per object) to O(K) (per cluster), with typically K≪N. For instance, 15,000 objects might be reduced to 25 clusters for annotation—a 600× reduction in human workload.
Pipeline Generality
Generalization across diverse tissue types using a uniform parameter configuration underscores the robustness of combining a versatile segmentation architecture (Cellpose-SAM) with generic, pretrained visual backbones and density-based unsupervised clustering. Notably, the pipeline is agnostic to object identity and operates equivalently on single cells, nuclei, or other cell-like structures, as dictated by the upstream segmentation output.
Limitations and Future Extensions
- Segmentation quality (boundary fidelity) and biological correctness of clusters are not directly assessed—only morphological similarity and cluster-label mapping.
- An experimental LLM-based cluster classification stage remains unevaluated.
- The absence of spatial context in clustering leads to confounds for tissues with context-dependent heterogeneity.
Integration of positional encoding, spatial context, tissue-specific parameterizations, or self-supervised representation learning tailored to histology may mitigate current limitations and further boost performance.
Conclusion
The proposed cluster-first labelling pipeline achieves high-precision, scalable cell and tissue component annotation for histology WSIs with minimal human input by integrating modern segmentation, feature extraction, and clustering in an unsupervised, modular pipeline. Quantitative and qualitative evaluations validate its generality and practical impact, particularly in reducing annotation burden. Extensions to embed richer spatial context or incorporate tissue-specific tuning represent natural directions for enhancing robustness and applicability. The open-source release ensures immediate utility for the computational pathology community.