 Temporal ensembling (TE) training:  Only \(\sim \) 6% of sections were manually charted, which would be insufficient for this challenging detection problem. Hence, after initially pretraining the model for \(Np\)  epochs using the manually charted samples alone, we used the additional unlabeled samples for training both \(F_{Seg}\)  and \(F_{Class}\) , using the temporal ensembling technique [1]}, where predictions from the previous \(r\)  epochs (\([P_{N-r}, ..., P_{N-1}]\) ) were averaged and thresholded to obtain the target label for the current epoch \(N\)  (we empirically set \(r\)  = 3). We used focal loss for pretraining the encoder-decoder of \(F_{Seg}\) , since contrastive loss was calculated at patch-level in \(F_{Class}\) . For the first 3 epochs after pretraining, predictions from the pretrained model \(P_{N_p}\)  were used for label generation. Averaging predictions reduced segmentation noise and aided in adapting the model to data from different brains.
