Faster Mean-shift: GPU-accelerated clustering for cosine embedding-based cell segmentation and tracking

Mengyang Zhao, Aadarsh Jha, Quan Liu, Bryan A. Millis, Anita Mahadevan-Jansen, Le Lu, Bennett A. Landman, Matthew J. Tyska, Yuankai Huo

Introduction

In biomedical research, tracking cell movement and division is fundamental to understanding complex biological processes like embryonic development and oncogenesis. Traditional methods often rely on a two-stage process: independent segmentation followed by temporal association. Recently, "single-stage" approaches using pixel embeddings have gained traction. These methods employ neural networks to map pixels into a high-dimensional space where pixels belonging to the same cell instance across time are clustered together.

Despite their high accuracy, these embedding-based methods face a significant computational bottleneck during inference. The standard Mean-shift algorithm used for clustering is prohibitively expensive, often requiring minutes to process a single frame. Furthermore, existing GPU-accelerated variants frequently suffer from excessive memory consumption, limiting their utility on standard research hardware. This paper introduces Faster Mean-shift, a GPU-accelerated clustering algorithm designed to overcome these limitations.

The Faster Mean-shift Framework

Faster Mean-shift is designed as a modular, "plug-and-play" component for any embedding-based pipeline. The framework's architecture integrates deep recurrent networks with a novel clustering module that operates entirely on the GPU.

The end-to-end pipeline for cell segmentation and tracking, integrating the Faster Mean-shift module after pixel-wise embedding.

The core innovations of the proposed method include:

  1. Full GPU Parallelization: Iterative mean-shift calculations are performed entirely on the GPU using optimized tensor operations, avoiding the overhead of CPU-GPU data transfer during the clustering loop.
  2. Online Seed Optimization Policy (OSOP): This is the primary breakthrough. Rather than using every pixel as a starting point (seed), OSOP adaptively determines the minimum number of seeds required to capture every cell instance with high probability (e.g., >99%). This probabilistic model dynamically adjusts seed counts based on foreground area and predicted cell density.
  3. Early Stopping Strategy: To mitigate the impact of slow-converging outlier pixels, the algorithm terminates once a threshold (e.g., 90%) of seeds has stabilized.
  4. Cosine Distance Optimization: The algorithm is specifically tuned for cosine similarity, which has proven more effective than Euclidean distance for resolving ambiguities at cell boundaries.

Experimental Evaluation

The researchers validated Faster Mean-shift using simulated tensors and four primary cohorts from the ISBI Cell Tracking Challenge, including HeLa cells, stem cells, and simulated nuclei.

Performance and Efficiency

The algorithm achieved a remarkable 7–10x speedup compared to the previous state-of-the-art RSHN framework. For instance, processing time for a standard HeLa cell frame was reduced from approximately 25 seconds to just 2.7 seconds. Crucially, this speedup does not come at the cost of memory; the reduced seed count allows the algorithm to run efficiently on consumer-grade GPUs like the RTX 2080 Ti.

Performance comparison of Faster Mean-shift against CPU and other GPU baselines, highlighting the balance between time cost and memory consumption.

Accuracy and Scalability

Despite the aggressive optimization and reduction in seed points, tracking accuracy (measured by the AOGM-TRA metric) remained virtually identical to the original, slower Mean-shift implementation. In scalability tests involving up to 200,000 vector points, Faster Mean-shift maintained stable performance, whereas other GPU-based benchmarks either slowed significantly or encountered memory overflow errors.

Discussion and Future Work

Faster Mean-shift addresses the critical inference bottleneck in embedding-based cell analysis. By treating seed placement as a probabilistic problem, the authors demonstrated that a small, intelligently selected subset of seeds can represent the entire population without compromising accuracy.

While the current 2D implementation offers significant benefits, extending the framework to 3D microscopy remains a priority. 3D datasets present even greater computational and memory challenges, where the efficiency gains of OSOP will be even more vital. Additionally, while the speedup is substantial, further refinements may be needed to achieve true real-time performance for ultra-high-resolution or extremely dense datasets.

The implementation is publicly available at https://github.com/masqm/Faster-Mean-Shift.

Summary updated

BibTeX
@article{zhao2021faster,
  author = {Mengyang Zhao and Aadarsh Jha and Quan Liu and Bryan A. Millis and Anita Mahadevan-Jansen and Le Lu and Bennett A. Landman and Matthew J. Tyska and Yuankai Huo},
  title = {{Faster Mean-shift: GPU-accelerated clustering for cosine embedding-based cell segmentation and tracking}},
  journal = {Medical Image Analysis},
  year = {2021},
  doi = {10.1016/j.media.2021.102048},
}
Figure