Fig. illustrates ion image representations after self-supervised learning using t-SNE visualization. Additional results are provided in Fig. . In the absence of a manual annotation, we use the same color for all the data points in Fig. . With the pre-trained EfficientNet-B0, we could only observe several aggregates at the edge of the 2D ion image representations. However, the uniformly distributed representations in the center of the plot cannot be used for identifying the co-localized ion images (Fig. ). After the contrastive learning step, the re-trained CNN encoder provides a substantially improved separation of the representations as shown in Fig. . Fig. shows ion image representations after selflabeling, which are color-coded with predicted colocalization labels. Tight clusters indicate co-localized molecular distribution patterns in the MSI data. Pairs of ion images were selected from clusters and placed around the t-SNE plot. Images from one pair have similar spatial features, while different pairs show distinct molecular localizations. These results confirm that the self-supervised clustering approach developed in this study provides accurate molecular localization representations of distinct spatial patterns observed in MSI data. Notably, some of the paired ion images have different noise levels (e.g., m/z 906.4314 vs m/z 915.4561) or different intensity levels (e.g., m/z 613.3477 vs m/z 817.1050). These results indicate that data augmentations used in the training step provide a sufficient generalization capability for the re-trained CNN model to identify high-level molecular localization. The ability to perform self-supervised clustering of the unannotated MSI data distinguishes our approach from previously reported methodologies . We also visualized the ion clustering results in the m/z space. Fig. shows an average mass spectrum over the m/z 600-1000 range, in which peaks are highlighted using the same color coding as that in Fig. . To further evaluate the accuracy of the clustering, we examined the isotopic recall , which quantifies the percentage of ion images of isotopic peaks correctly grouped together. We identified isotopic ions based on both the accurate m/z shift and Pearson correlations of ion images (Methods). For example, in Fig. , co-localized isotopic peaks observed in the m/z range of 736-765 are annotated using compound indices in gray color, which are ranked by their primary isotopic m/z values. Ion image colocalization results of selfsupervised clustering and EfficientNet-B0 followed by SC are also annotated by colocalization class number with blue and red colors, respectively. We note that independent class numbers were assigned to these two classification results. With the expectation that isotopic images should be clustered into the same group, we identified the correctly and falsely classified isotopic ions in clustering results (Methods) and marked false isotopic classification with an asterisk. In the mass range shown in Fig. , EfficientNet-B0 and SC falsely classified 3 isotopic peaks, while the self-supervised clustering approach correctly grouped all the isotopic peaks. This result further confirms the accuracy and robustness of the self-supervised clustering. Values of the isotopic recall obtained using different clustering methods are summarized in Fig. . For the clustering involving the CNN encoder and SC, contrastive learning (SimCLR) improves the isotopic recall from 75.4% to 90.2%. With the self-labeling, the final model reaches an isotopic recall of 92.1%, which indicates the superior clustering performance of this approach.