Statistics for Unsupervised Losses for Clustering and Segmentation of Images: Theories & Optimization Algorithms