Classification of complex 2D magnetic ground states using unsupervised contrastive learning