820 likes | 955 Views
An introduction to Generalized K-means with image processing applications. Jeremy Watt and Reza Borhani. What we’ll discuss. The cutting edge – Dictionary Learning and large scale image compression From K-means to G- Kmeans (aka Dictionary Learning)
E N D
An introduction to Generalized K-means with image processing applications Jeremy Watt and Reza Borhani
What we’ll discuss • The cutting edge – Dictionary Learning and large scale image compression • From K-means to G-Kmeans (aka Dictionary Learning) • A tried and true application of G-K Means in Image Processing
Image compression via G-Kmeans An 8x8 block
Image compression via G-Kmeans • Say we have a robust matrix D that can represent image blocks from like images well as a sparse sum of its columns So we essentially have where # nonzero values in Standard basis
Image compression via G-Kmeans Image adapted from Irina Rish’s Sparse Statistical Models Course
Image compression via G-Kmeans • Can record far fewer coefficients than pixel values! • Since sender and receiver both have Dictionary, we just send a few coefficients – much cheaper!
How do we find the right fit? subject to • Greed is Good - what is a greedy approach to solving this problem? • Repeat S times • Cycle through each column of D not yet used and find the single best fit • Subtract the best column’s influence from y
Francis Bach et al. Sparse Coding and Dictionary Learning for Image Analysis Part III: Optimization for Sparse Coding and Dictionary Learning
How do we find the right fit? subject to • Greed is Good - what is a greedy approach to solving this problem? for
The era of Big Data 250 million images uploaded to Facebook everyday. There are currently ~ 90 billion photos totalon Facebook. In 2007, almost 70 million CT-scans performed only in the U.S. bits Joint Compressor JPEG JPEG JPEG bits bits bits Joint Compressor bits DICOM DICOM DICOM bits bits bits
What is data clustering? • A method for understanding the structure of a given (training) data set via clustering. • A way of classifying points in a newly received (test) data set • K-means is the most popular method
Begin Training Phase First – Initialize centroids
Pick K centroids • Repeat until convergence • Assign each (training) point to its closest centroid • Re compute centroid locations • Output final K centroids and assignments
Shortcomings • Number of centroids? • Initialization? • Are yours the right ones? • non-glob clusters • complexity
Classification • Not the best, but not bad right out of the box • MNIST dataset – 60,000 training, 10,000 test • Compeitors include SVMs, Logistic regression, etc.
(Pseudo) Image Compression • Per pixel: instead of (R,G,B) store index of closest centroid • Also called vector quantization • Image taken from Bishop’s Pattern Recognition
Y For P Points
= = x Assignment vector
= = X For P Assignments
Notice • Columns of X – assignment of one data point • Rows of X – all assignments to a single centroid =
K-Means algorithm: Notation • Centroid location matrix • Data matrix • Assignment matrix
K-Means algorithm: Notation • Centroid matrix • Data matrix • Assignment matrix • the kth cluster • the cardinality of the kth cluster
K-means algorithm Input: Y, initial D and X Output: Final D and X Until Convergence: for p (Update Assignments) for (Update Centroids)
K-means algorithm Input: Y, initial D and X Output: Final D and X Until Convergence: for p (Update Assignments) for (Update Centroids)
K-means algorithm Input: Y, initial D and X Output: Final D and X Until Convergence: for p (Update Assignments) for (Update Centroids)
K-means algorithm Input: Y, initial D and X Output: Final D and X Until Convergence: for p (Update Assignments) for (Update Centroids)
K-means algorithm Input: Y, initial D and X Output: Final D and X Until Convergence: for p (Update Assignments) for (Update Centroids) The kth row of X
For example say we • 4 data points,,, • 2 centroids , Then records which points are assigned to the first centroid. And