How CNNs and ViTs perceive similarities between categories