where \(\alpha \)  and \(\gamma \)  are weighing and focusing parameters, respectively, and \(p\in \) [0,1] is the predicted probability for the fiber bundle class. As mentioned earlier, the manual charting of fiber bundles does not include all fiber regions and might not be precise along the boundaries. Moreover, we have texture variations and noise in the background. Therefore, we
used a self-supervised technique for training \(F_{Class}\)  that learns intrinsic texture/intensity variations in addition to the fiber features from the manual charting alone. We used a contrastive loss function based on SimCLR [1]}, where augmented data from each sample constitute the positive example to the sample while the rest were treated as negatives for the loss calculation. In SimCLR, random cropping and color distortions were shown to perform well. In our case we adapted the learning method by choosing augmentations better suited to our problem: (i) random cropping of patches closer to the input patch (\(<\)  20\(\mu \) m), constrained within the white matter (by iterative sampling of patches until mean intensity criterion is satisfied), (ii) noise injection + Gaussian blurring (with randomly chosen \(\sigma \in \)  [0.05, 0.3]). The self-supervised loss with the above augmentations has two advantages: (1) effective separation between fiber and non-fiber background patches and (2) identification of fiber patches correctly even in the presence of artifacts, aided by the shared weights in the encoder of \(F_{Seg}\) . We used the contrastive loss [1]} (eqn. REF ) between positive pairs of patches \((i, j)\)  of \(F_{Class}\) , given by:
\(\vspace{-5.0pt}CL(i, j) = \frac{exp(sim(f_i, f_j)/\tau )}{\sum _{k=1}^{2N} I_{k \ne i}~exp(sim(f_i, f_k)/\tau )}, \quad sim(x, y) = \frac{x^Ty}{|| x ||\hspace{2.5pt} || y ||}\) 
