Skip to content
AI.info

Research

Linear time small coresets for k-mean clustering of segments with applications

Overview Research area: Theoretical machine learning and computational geometry, specifically coreset constructions and approximation algorithms for clustering. Technical level: Advanced. The paper is

arXiv
2511.12564
Published
2025-11-16
Authors
David Denisov, Shlomi Dolev, Dan Felmdan, Michael Segal

AI summary

Overview

Research area: Theoretical machine learning and computational geometry, specifically coreset constructions and approximation algorithms for clustering.

Technical level: Advanced. The paper is primarily a theory contribution built on sensitivity analysis, VC-dimension arguments, and approximation guarantees, though the application sections (video tracking) are accessible to a general audience.

Scope: The paper gives the first provable coreset construction for k-means clustering of arbitrary line segments in ℝ^d, with linear-time computation, and demonstrates the construction on synthetic data, motion vectors, road networks, and real-time video tracking.

What This Paper Is About

Standard k-means clustering operates on discrete points, but many real datasets — road networks, maps, image features, motion vectors — are better modeled as continuous line segments rather than points. Clustering segments is harder than clustering points because the "distance" from a segment to a center is an integral over the whole segment rather than a finite sum. This paper builds a small, weighted set of representative points (a coreset) that can stand in for the full set of segments when solving the k-means problem, while provably preserving the clustering loss up to a factor of 1 ± ε.

Key Contributions

  1. The first provable coreset for arbitrary input segments. The authors state that no provable algorithms previously existed for segment clustering. Their construction handles any set of n segments in ℝ^d and, for constant k and ε, yields a coreset of size O(log² n) computable in O(nd) time.

  2. A reduction from segment clustering to point clustering. The main novelty is a proof that the segment clustering problem can be reduced to an ordinary point-clustering problem, letting the authors reuse existing, well-developed coreset machinery for weighted points.

  3. A finite deterministic coreset for a single segment (Algorithm 1, Seg-Coreset). Prior discrete-integral results applied directly to a segment would produce an infinite coreset; the authors instead give a finite sampling scheme with a hard bound for finite samples, generalizing earlier coreset constructions for points to infinitely many points along a segment.

  4. Extension beyond segments. Since convex sets can be viewed as unions of infinitely many segments, the authors state that the technique also yields small coresets for n ≥ 1 convex sets (Algorithm 3), and that the focus on fitting weighted centers extends to hyperplane fitting.

Main Findings

  • Coreset size and runtime (main theoretical result): For a set L of n segments and parameters ε, δ ∈ (0, 1/10], Algorithm 2 (Coreset) returns, with probability at least 1 − δ, an (ε, k)-coreset of L. The size bound is |P| ∈ (k' log² m / ε²) · O(d* + log(1/δ)), where m := 8kn(20k)^{r+1}/ε and k' ∈ (k+1)^{O(k)}. Computation time is m t k' + t k' log(m) · log²(log(m)/δ) + (k' log³ m / ε²) · (d* + log(1/δ)). For constant k and ε this is a size of O(log² n) in O(nd) time.

  • Single-segment coreset (Theorem 2.2): Seg-Coreset(ℓ, k, ε) sets ε' := ⌈4k(20k)^{r+1}/ε⌉, samples the points ℓ(i/ε') for i ∈ {0, …, ε'}, assigns each weight 1/ε', and returns a weighted set that is an (ε, k)-coreset for the segment ℓ. The parameter r depends on the distance function — r = 1 for absolute error and r = 2 for MSE, per the paper.

  • Provable k-means approximation (Corollary 1): For a set L of n segments and ε, δ ∈ (0, 1/10], a set P ⊂ ℝ^d of size k can be computed in O(nk³ ε log(1/δ)) time such that, with probability at least 1 − δ, loss(P, L) is within O(log k) of the optimal k-center loss.

  • Empirical comparison against line clustering: In experiments, Our-Method (coreset of 10 points per segment via Seg-Coreset, then k-means++) consistently achieved lower loss and significantly faster runtimes than Line-Clustering from prior work, which extends each segment to an infinite line and is described as the closest available baseline. The authors note that no provable or commonly used methods exist for segment clustering, making this the only relevant comparison. Runtimes were dominated by the k-means++ call.

  • Video tracking speed: The tracking algorithm processed a 400-frame Big Buck Bunny clip in 0.28 seconds (over 1,400 fps), compared with 33.4 seconds (12 fps) reported for YOLOv8 on the same clip.

  • Single-board computer performance: Re-running the test on a Libre Computer AML-S905X-CC (Le Potato) took 4.23 seconds for 400 frames, over 94 fps, with results essentially unchanged apart from minor differences from clustering tie-breaking and sample noise.

Methodology in Plain English

The key insight is that you do not need to keep the segments themselves. For each segment, the authors replace the continuous object with a small, weighted set of sampled points along it. Because the k-means loss over a segment is an integral, having a finite weighted point set that approximates that integral is enough to approximate the clustering objective.

The construction is deterministic for a single segment: pick a specific number of evenly spaced parameter values along the segment, weight them equally, and that weighted set provably captures the segment's contribution to the loss for any choice of k centers. The authors prove this by bounding the "sensitivity" — the maximum contribution any single point can make to the total loss — for r-log-Lipschitz functions and for minima over families of such functions, then converting that sensitivity bound into a coreset.

For many segments, the algorithm applies the single-segment construction to each segment, takes the union of all resulting points, and then compresses that union further using an existing coreset algorithm for weighted points. The final output is a small weighted set of points that can be fed into any off-the-shelf k-means solver, such as k-means++.

The evaluation kept the theory honest: it compared against the only available prior method, used the same coreset machinery but with a much larger coreset (10,000 points per segment) to approximate the loss for scoring, and reported medians over repeated runs with interquartile error bars. The video application converted motion vectors extracted by standard video encoders into 4-dimensional segments, sampled up to 1,000 of them per 10-frame window, compressed each to 10 points, and ran k-means to track the largest cluster.

Why This Matters

Impact on research: The paper extends coreset theory from discrete points and lines to continuous segments, filling a gap the authors identify — line clustering had provable approximations, but segment clustering had none. The reduction to point clustering lets a large existing body of k-means research be applied directly to structured, continuous data, and the sensitivity-bounding machinery for continuous integrals may be reusable elsewhere.

Real-world applications (as described or demonstrated in the paper):

  • Video tracking and object detection using motion vectors from standard codecs such as H.264 and H.265, without processing RGB frames.
  • Facility location and infrastructure planning, illustrated by clustering road networks.
  • Spatial data analysis over maps and road networks.
  • Scalable streaming, distributed, and parallel computation, since coresets allow the expensive clustering step to operate on a small summary rather than the full input.

Industry relevance: Because the method uses only motion vectors rather than pixel data, the paper notes it can enable real-time tracking while preserving some degree of privacy, and it can run on low-end hardware such as a single-board computer. The paper also frames coresets as enabling distributed and streaming pipelines, and the authors note that neural network approaches require costly training and labeling and often need mid-level GPUs for roughly 30 fps.

Future Directions

  • Single-cluster assignment variant: The authors did not analyze the version of the problem where each segment must be assigned to exactly one center. They believe this would follow from combining their result with Section 15.2 of a cited reference, but note that even after compression this becomes a complex set-clustering problem.
  • Non-elementary loss functions: The results support loss functions where the integral in the problem definition is not elementary; the authors state that direct minimization in such cases seems infeasible to them, leaving the question of how to handle these directly.
  • Extension to general multi-dimensional shapes: The appendix generalizes the results to multi-dimensional shapes, suggesting further generalization as a direction.
  • Hyperplane fitting: The authors note that their focus on fitting weighted centers extends naturally to hyperplane fitting, which is stated but not developed as an application in the main text.

Target Audience

This paper is most valuable to researchers in computational geometry, coreset and approximation-algorithm theory, and clustering who need provable guarantees for continuous or structured data. It also suits applied machine learning engineers working on video analytics, geospatial clustering, or road-network analysis who want a lightweight, theoretically grounded preprocessing step that plugs into standard k-means implementations. Readers without a background in approximation algorithms will find the theoretical sections demanding, but the empirical and application sections are largely self-contained.

Authors’ abstract

We study the $k$-means problem for a set $\mathcal{S} \subseteq \mathbb{R}^d$ of $n$ segments, aiming to find $k$ centers $X \subseteq \mathbb{R}^d$ that minimize $D(\mathcal{S},X) := \sum_{S \in \mathcal{S}} \min_{x \in X} D(S,x)$, where $D(S,x) := \int_{p \in S} |p - x| dp$ measures the total distance from each point along a segment to a center. Variants of this problem include handling outliers, employing alternative distance functions such as M-estimators, weighting distances to achieve balanced clustering, or enforcing unique cluster assignments. For any $\varepsilon > 0$, an $\varepsilon$-coreset is a weighted subset $C \subseteq \mathbb{R}^d$ that approximates $D(\mathcal{S},X)$ within a factor of $1 \pm \varepsilon$ for any set of $k$ centers, enabling efficient streaming, distributed, or parallel computation. We propose the first coreset construction that provably handles arbitrary input segments. For constant $k$ and $\varepsilon$, it produces a coreset of size $O(\log^2 n)$ computable in $O(nd)$ time. Experiments, including a real-time video tracking application, demonstrate substantial speedups with minimal loss in clustering accuracy, confirming both the practical efficiency and theoretical guarantees of our method.

Read the original paper