The self-supervised approach for molecular colocalization developed in this study is illustrated in Fig. . The approach is based on training a CNN to learn representations of molecular localizations and classify molecular images into groups based on high-level spatial features. The clustering results provide a concise presentation of the spatial patterns present in large MSI data, which is critical to understanding the relevant biochemical pathways. To facilitate the autonomous and high-throughput MSI-based scientific discovery, we train our model in a self-supervised manner without manual annotations. This is achieved using image augmentation, which enables an effective self-supervised training of a deep CNN with a limited number of ion images. The self-supervised clustering approach developed in this study is summarized in Fig. . The approach relies on the following three steps described in detail later: 1) Contrastive learning of molecular localization representations using SimCLR; 2) Image clustering based on the representations and 3) Selflabeling of the clustered images. In order to assess the improvement of the model during the self-supervised training, we systematically evaluated each training step using a manually annotated benchmark MSI dataset of a mouse uterine tissue acquired using nanospray desorption electrospray ionization (nano-DESI). The mouse uterine tissue with several distinct cell types is an excellent model system, which presents diverse molecular localizations. From the data acquired in both positive and negative ionization modes, we manually selected 367 ion images (96 x 96 pixels) and clustered them into 13 classes (Methods). We then validated our approach using a publicly available mouse brain tissue MSI dataset from METASPACE . It is acquired using matrixassisted laser desorption/ionization (MALDI), which contains 1101 high resolution ion images (224 x 224 pixels) without annotations. Our results demonstrate the robustness of the self-supervised image clustering approach for MSI datasets of different sizes, spatial resolutions, tissue types, and acquisition conditions.