[Paper Review] Unsupervised visualization of image datasets using contrastive learning
This paper proposes t-SimCNE, a contrastive learning-based method that trains a parametric 2D embedding network to visualize image datasets unsupervised. By combining SimCLR-style contrastive pretraining with t-SNE-style neighbor modeling in 2D, t-SimCNE achieves state-of-the-art k-NN classification accuracy (89% on CIFAR-10, 51% on CIFAR-100) while enabling out-of-sample inference, producing semantically meaningful, interpretable visualizations of image clusters, artifacts, and outliers.
Visualization methods based on the nearest neighbor graph, such as t-SNE or UMAP, are widely used for visualizing high-dimensional data. Yet, these approaches only produce meaningful results if the nearest neighbors themselves are meaningful. For images represented in pixel space this is not the case, as distances in pixel space are often not capturing our sense of similarity and therefore neighbors are not semantically close. This problem can be circumvented by self-supervised approaches based on contrastive learning, such as SimCLR, relying on data augmentation to generate implicit neighbors, but these methods do not produce two-dimensional embeddings suitable for visualization. Here, we present a new method, called t-SimCNE, for unsupervised visualization of image data. T-SimCNE combines ideas from contrastive learning and neighbor embeddings, and trains a parametric mapping from the high-dimensional pixel space into two dimensions. We show that the resulting 2D embeddings achieve classification accuracy comparable to the state-of-the-art high-dimensional SimCLR representations, thus faithfully capturing semantic relationships. Using t-SimCNE, we obtain informative visualizations of the CIFAR-10 and CIFAR-100 datasets, showing rich cluster structure and highlighting artifacts and outliers.
Motivation & Objective
- To address the failure of traditional neighbor embedding methods like t-SNE and UMAP when applied directly to pixel space, where Euclidean distances do not reflect semantic similarity.
- To develop a parametric, unsupervised 2D embedding method that preserves semantic relationships in image data without requiring labels.
- To enable out-of-sample inference by learning a differentiable mapping from pixel space to 2D, overcoming limitations of non-parametric visualization methods.
- To combine the strengths of contrastive learning (semantic representation learning) and t-SNE (neighborhood preservation in 2D) into a single, end-to-end trainable framework.
Proposed method
- The method uses a ResNet backbone with a 2D projection head to map input images to a 2D embedding space.
- It applies data augmentation to create positive pairs from the same image, using standard augmentations like random crop and color jitter.
- The contrastive loss is optimized using the InfoNCE objective, maximizing the similarity between augmented views in the 2D embedding space.
- The 2D similarity is modeled using the Cauchy (t-distribution) kernel, mirroring t-SNE’s approach to preserve local neighborhood structure.
- A three-stage training protocol is employed: pre-training with a 128D head for 1000 epochs, fine-tuning only the 2D readout for 50 epochs, and end-to-end fine-tuning for 450 epochs.
- The final model is parametric, allowing inference on new, out-of-sample images by applying the learned mapping directly.
Experimental results
Research questions
- RQ1Can a contrastive learning framework be adapted to produce high-quality, interpretable 2D visualizations of image datasets without using labels?
- RQ2Does a 2D parametric embedding trained via contrastive learning preserve semantic structure as effectively as high-dimensional SimCLR representations?
- RQ3How does t-SimCNE compare to non-parametric methods like t-SNE applied to SimCLR features in terms of cluster separation and outlier detection?
- RQ4Can the method effectively reveal fine-grained structure such as subclasses, artifacts, and anomalies in datasets like CIFAR-10 and CIFAR-100?
Key findings
- t-SimCNE achieves a k-NN classification accuracy of 89% on CIFAR-10 and 51% on CIFAR-100, matching the performance of high-dimensional SimCLR representations.
- The visualizations reveal rich cluster structures, clearly separating classes and highlighting outliers and artifacts, which are often missed by pixel-space t-SNE.
- Compared to t-SNE applied to SimCLR features, t-SimCNE produces more interpretable visualizations with better-defined class boundaries and more noticeable structural details.
- The method enables out-of-sample inference, a key advantage over non-parametric visualization techniques, allowing new images to be embedded into an existing 2D space.
- While the 2D output leads to slightly worse representation quality in the high-dimensional feature space (H) compared to standard SimCLR, the trade-off is justified by the gains in visualization utility.
- The method outperforms off-the-shelf ImageNet-pretrained ResNet features visualized via t-SNE in terms of clustering-based adjusted Rand index, indicating superior class separation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.