Academia.eduAcademia.edu

GPU Acceleration of Iterative Clustering

Abstract

Iterative clustering algorithms based on Lloyds algorithm (often referred to as the k-means algorithm) have been used in a wide variety of areas, including graphics, computer vision, signal processing, compression, and computational geometry. We describe a method for accelerating many variants of iterative clustering by using programmable graphics hardware to perform the most computationally expensive portion of the work. In particular, we demonstrate significant speedups for k-means clustering (essential in vector quantization) and clustered principal component analysis. An additional contribution is a new hierarchical algorithm for k-means which performs less work than the brute-force algorithm, but which offers significantly more SIMD parallelism than the straightforward hierarchical approach.

Key takeaways

  • Each cluster has a model, which is used in evaluating the metric, and in some applications is the primary output of the algorithm.
  • One of the simplest and most widely used applications of this algorithm is k-means clustering, where a set of input vectors are clustered based on Euclidean distance to the cluster mean (the model for each cluster is the mean of the points in the cluster from the previous iteration).
  • Doing the tree traversal on the GPU would be possible (cluster means would have to be in textures due to lack of indexing of fragment shader constants), but would probably require multiple passes with the results of each pass used as input to the next, and quite a bit of additional shader overhead, including dependent texture fetches.
  • When clustering, the metric for a (point, cluster) pair is the squared length of the residual ||p i − p i || 2 , which can be simplified to
  • As explained in Section 3.2, the number of state changes (consisting of loading data into the fragment shader constant registers) as well as the amount of data transferred to the GPU on each iteration is proportional to the number of clusters.