In this article, the GMM-EM soft clustering technique will be used to cluster a bunch of images. The average RGB value will be used to represent an image (the input images consist of a few sky-cloud images, sunset images, forest images or sea images, each category has a different range of average RGB values, so this technique is supposed to work).
This problem has appeared as a python assignment problem in the Coursera Course ML Clustering and Retrieval (by UW).
- The following images shown are used for the GMM EM clustering.
- The EM algorithm shown in the following figure is used for soft clustering.
- The next animation / figure shows how the GMM-EM gradually converged with iteration along with the increase in log-likelihood per iteration. The x and y axes represent the R channel and the G channel corresponding to a pixel’s RGB value and each point represents an image’s average RGB value.
- The next figures show the 4 image clusters obtained. Each cluster is marked by the convex hull containing the images belonging to the cluster.
- As expected, the sky-cloud images are all assigned to one cluster with high probability, whereas the green forests, sea images and sunset images form the remaining 3 clusters respectively.