Abstract
Clustering continuous geometric objects like line segments is computationally challenging due to the need for integral-based loss functions. We present the first provable algorithm for constructing small coresets for $k$-means clustering of segments. Our approach reduces continuous segments into a small, weighted set of points in $O(nd)$ time. Empirical results demonstrate significant speedups, enabling real-time video tracking at over 1,400 frames per second with minimal accuracy loss.
Introduction
Clustering is a cornerstone of data analysis, typically applied to discrete point sets. However, many real-world datasets are better modeled as continuous segments, such as road networks, trajectories, or image features. Unlike point-based $k$-means, clustering segments requires calculating the distance from data to cluster centers using integrals, a significantly harder problem. Previous methods often simplified segments into infinite lines, losing crucial boundary information. This paper introduces the first provable coreset construction for $k$-means clustering of arbitrary segments.
Methodology
The proposed method utilizes a two-stage reduction process to create a coreset—a highly compressed version of the dataset that preserves clustering properties.
- Segment-to-Points (Algorithm 1): Each segment is deterministically sampled to produce a small number of representative points. The researchers prove that a weighted sum of distances to these points accurately approximates the integral of the distance to the entire segment within an $\epsilon$ factor.
- Point-to-Coreset (Algorithm 2): The resulting large collection of points is further compressed using existing, efficient point-clustering coreset techniques.
The final coreset has a size of $O(\log^2 n)$ and is computed in $O(nd)$ time, making it suitable for large-scale and streaming data.
Experimental Evaluation
The method was evaluated on synthetic data, road segments from OpenStreetMap (1 million segments), and motion vectors from the "Big Buck Bunny" animated film.
Key Results
- Accuracy: The proposed method consistently outperformed traditional "Line-Clustering" by achieving lower Mean Squared Error, as it accounts for segment endpoints.
- Performance: On a standard PC, the algorithm processed 720p video at over 1,400 frames per second (fps).
- Edge Deployment: On low-power hardware like the "Le Potato" single-board computer, the system maintained 94 fps, significantly outperforming deep learning models like YOLOv8 (12 fps).
Conclusion
This work provides a theoretically grounded and practically efficient solution for clustering segment data. By approximating continuous integrals with discrete weighted points, the authors achieve linear-time performance suitable for real-time applications. Future work includes extending this framework to more complex convex shapes and refining the single-center constraint for segment assignment.
Summary updated