Neural network-based clustering using pairwise constraints