The self-labeling step shown in Fig. fine-tunes both the CNN encoder and linear classifier by ensuring that augmentations of the same ion image are be classified into the same group. This approach further enhances the generalization power of the model, which becomes tolerant towards visual variations originating from strong data augmentations (Methods). To optimize the training process, only confidently classified images are included in self-labeling.