This document discusses the implementation of the CLARANS K-medoid clustering algorithm in Java. It also explores using the Torch machine learning library and Torch3Vision for image processing tasks like face detection. Different distance functions for clustering algorithms are analyzed and how they relate to spatial versus spectral patterns in images. The document presents results of clustering a sample image using K-medoid while varying the preference for spatial or spectral patterns.