Faster Mean-shift: GPU-accelerated Embedding-clustering for Cell Segmentation and Tracking

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

Abstract

Embedding-based deep learning models for cell segmentation and tracking are highly accurate but suffer from slow inference due to the computational bottleneck of mean-shift clustering. We present "Faster Mean-shift," a GPU-accelerated algorithm utilizing an adaptive seeding strategy to significantly reduce computational time. By intelligently selecting the minimum required seeds via an Online Seed Optimization Policy (OSOP), our method achieves a 7-10x speedup over existing CPU-based approaches while maintaining low memory usage suitable for standard GPUs, without compromising segmentation accuracy.

Introduction

In biomedical research, the automated segmentation and tracking of cells in microscopy videos is essential. Recent single-stage "embedding-based" deep learning methods, such as Recurrent Stacked Hourglass Networks (RSHN), have gained popularity for their accuracy. These models map pixels to high-dimensional embedding vectors where pixels of the same cell exhibit high cosine similarity.

However, grouping these pixels into discrete cell instances relies on mean-shift clustering. While accurate and flexible (not requiring a predefined cluster count), mean-shift is computationally expensive with $O(Tn^2)$ time complexity. On a CPU, this can take minutes per frame for high-resolution images. Existing GPU-accelerated versions often fail to provide sufficient speedup or suffer from Out-Of-Memory (OOM) errors on standard hardware due to over-parallelization. This paper addresses this bottleneck by introducing a fast, memory-efficient mean-shift algorithm.

Methodology: Faster Mean-shift

The proposed "Faster Mean-shift" is a plug-and-play GPU-accelerated clustering algorithm that optimizes the parallelization process through two primary strategies:

Overview of the cell segmentation and tracking pipeline using Faster Mean-shift.

Online Seed Optimization Policy (OSOP)

Traditional mean-shift often uses every pixel as a starting "seed," which is redundant for image segmentation. OSOP adaptively calculates the minimum number of seeds required to ensure every cell instance is identified. Using a binomial distribution model based on foreground area and average cell size, it guarantees (with >99% probability) that each cell receives at least one seed, drastically reducing the number of trajectories to compute.

Early Stopping and Parallelization

Parallel GPU computing is often limited by the slowest thread. The authors observed that a small fraction of seeds take significantly longer to converge. By implementing an early stopping strategy—terminating the iteration once 90% of seeds have converged—the algorithm avoids these bottlenecks with negligible impact on final accuracy. This approach balances GPU parallelization with strict memory constraints, preventing OOM crashes.

Experimental Evaluation

The approach was validated using both simulated and real-world datasets:

  • Simulated Data: 2D polar coordinate datasets were used to test theoretical seed probabilities and scaling performance (from 1K to 200K points).
  • ISBI Cell Tracking Challenge: Real-world microscopy sequences including HeLa cells, mouse stem cells, simulated nuclei, and glioblastoma-astrocytoma cells were used to benchmark practical performance.

Key Results

Faster Mean-shift demonstrates significant improvements in both speed and resource efficiency:

Performance comparison of Faster Mean-shift against CPU and baseline GPU implementations in terms of time cost and memory consumption.
  • Speedup: The algorithm achieved a 7-10x speedup on real-world datasets compared to CPU-based mean-shift. For instance, processing time for the Fluo-N2DH-GOWT1 dataset was reduced from ~115 seconds/frame to ~11.2 seconds/frame.
  • Memory Efficiency: GPU memory consumption remained between 6-8 GB, fitting comfortably on standard GPUs (e.g., Tesla K80). In contrast, fully parallel GPU baselines (GPU_P) frequently encountered memory overflows.
  • Accuracy Preservation: The performance gains did not degrade tracking or segmentation quality, as measured by the standard AOGM-TRA metric.

Conclusion and Future Work

Faster Mean-shift provides a practical solution for accelerating embedding-based cell tracking. By replacing brute-force parallelization with a mathematically grounded seeding policy, it enables high-performance inference on standard hardware. While currently optimized for 2D imaging, future work aims to extend this to 3D microscopy, which will require further memory optimizations. Additionally, while the 7-10x speedup is substantial, achieving true real-time (millisecond-level) processing remains an ongoing challenge.

Summary updated

BibTeX
@misc{zhao2020faster,
  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. Tyskac and Yuankai Huo},
  title = {{Faster Mean-shift: GPU-accelerated Embedding-clustering for Cell Segmentation and Tracking}},
  year = {2020},
  eprint = {2007.14283},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.14283},
}
Figure