k-Means Clustering of Lines for Big Data

Yair Marom, Dan Feldman

Abstract

This paper introduces the first Polynomial Time Approximation Scheme (PTAS) and coreset construction for clustering lines in high-dimensional space. By reducing massive datasets into small, representative summaries, the authors enable $k$-means and $k$-median clustering for streaming and distributed data with provable accuracy and near-logarithmic memory usage. The proposed framework addresses the mathematical challenges inherent in line-based clustering, where traditional point-based assumptions like the triangle inequality do not hold. Experimental results demonstrate that this approach significantly outperforms industry-standard methods such as RANSAC and EM in both accuracy and scalability.

Introduction

Standard clustering algorithms, most notably $k$-means, are typically designed to handle discrete points in space. However, many real-world datasets are more accurately represented as lines or trajectories. In computer vision, for example, a drone captured by multiple cameras generates a set of rays (lines) passing through camera pinholes; the drone's actual position is the point where these lines intersect. In data science, a database record with a missing entry is not a fixed point in $d$-dimensional space, but rather a line representing all possible values for that missing dimension. Similarly, in robotics, tracking moving objects often involves modeling paths as linear trajectories.

Despite these applications, lines are mathematically more complex than points. They do not satisfy the standard triangle inequality—two parallel lines can be far apart while both intersecting a third line—which breaks the theoretical guarantees of traditional clustering. This paper provides the first efficient, provable solution for clustering lines in large-scale "Big Data" scenarios.

Methodology

The authors bridge the gap between theory and practice through a multi-stage algorithmic framework designed to handle high-dimensional data efficiently.

1. The Centroid-Set

The researchers prove that an approximate solution to the $k$-line problem can be found by examining a specific set of points derived from the closest distances between pairs of input lines. This "Centroid-Set" effectively narrows the search space for optimal cluster centers.

2. Bi-Criteria Approximation

To initialize the clustering process, the authors employ a fast, recursive sampling algorithm. This provides a "good enough" initial clustering that serves as a necessary stepping stone for the more precise coreset construction.

3. Coreset Construction via Sensitivity Sampling

The core innovation of this work is the "coreset"—a small, weighted subset of the data that behaves almost identically to the full dataset for any potential clustering query. The authors use sensitivity sampling to assign an importance score to each line based on its contribution to the total cost. By intelligently sampling lines with higher sensitivity, they create a summary that is near-logarithmic in size relative to the original dataset $n$, yet maintains a $(1 + \epsilon)$ approximation of the optimal answer.

4. Merge-and-Reduce Framework

To support Big Data applications, the authors utilize a tree-based "merge-and-reduce" structure. This allows the algorithm to handle streaming data (processing lines one by one without storing the entire set) and distributed computing (splitting the workload across multiple cloud nodes).

Experimental Evaluation

The researchers evaluated their approach on a mix of synthetic and real-world datasets:

  • Open Street Map (Roads): 10,000 road segments in China, modeled as infinite lines on a 2D plane.
  • UCI Security Camera Dataset: 40,000 high-dimensional observations (114 features) used to test performance on complex signals.
  • Synthetic Benchmarks: Controlled sets of 10,000 lines used to measure error rates and variance against known ground truths.

Key Results and Insights

  • Theoretical Breakthrough: This work provides the first PTAS for the $k$-line median problem in $\mathbb{R}^d$ that runs in near-linear time $O(n \log n)$. By reformulating the distance function for lines as a polynomial, the authors were able to apply classic computational geometry bounds, such as VC-dimension, to prove the simplicity of the line-clustering shape.
  • Superior Accuracy: In comparative tests, the coreset-based approach achieved an error rate of 0.86, significantly outperforming the industry-standard RANSAC (error of 2.62) and standard Expectation-Maximization (EM) algorithms using the same sample size.
  • Linear Scalability: When deployed on Amazon EC2, the construction time decreased near-linearly as more machines were added. This demonstrates the algorithm's readiness for massive, distributed cloud applications.
  • Robustness: The framework naturally extends to robust clustering, allowing the algorithm to ignore the farthest $m$ lines to mitigate the impact of outliers and noise.

Conclusion and Future Work

While this research masters the clustering of 1-dimensional lines, many real-world problems involve higher-dimensional "flats," such as 2D planes or 3D subspaces within a 10D space. The authors identify the generalization of these coreset techniques to $j$-dimensional affine subspaces as a primary goal for future work. Additionally, they aim to apply these subspace clustering techniques to data imputation problems involving records with multiple missing entries, further expanding the utility of coresets in data cleaning and recovery.

Summary updated

BibTeX
@inproceedings{marom2019k,
  author = {Yair Marom and Dan Feldman},
  title = {{k-Means Clustering of Lines for Big Data}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
}
Figure