## 5 Results and Evaluation
In the pretext part, it shows the effect of utilizing various contrastive loss functions on training the model. For this, we randomly selected ten fonts from each language, i.e., Chinese, English, and Korean, and plotted the embeddings of 10 characters in each font. The model can group all the font images belonging to the same font style irrespective of the character content of the images. Moreover, if we closely inspect all the visualizations of embedding vectors for NT-Xent, Triplet loss, and Supervised Contrastive loss functions, we will notice that supervised contrastive loss projections are the most segregated of the three. Supervised contrastive training produces better clusters for image representations because it is trained using labels; this explains why supervised contrastive loss is superior to the other loss functions. Contrary to training the model using labels, the triplet loss function also produced well-separated projections, while the NT-Xent loss function produced less separated projections. Overall, the results suggest that the supervised contrastive loss function is superior to the other loss functions in this font classification task. To further establish the effectiveness of training our model with a contrastive loss function for learning individual font styles, rather than relying on labels and cross-entropy loss for classification, we conducted an experiment to recommend similar font styles based on input font images. Figure 6 shows the recommended similar images for query  
Figure 5: t-SNE Projections of Chinese, English, and Korean embeddings vectors models trained using NT-Xent, Triplet loss and supervised contrastive loss. Images with the same color represent the same font style. images in Chinese, English, and Korean font styles on the seen and unseen images during training. After training the models of all languages, i.e., Chinese, English, and Korean, we removed the projection layer and passed all the images through the encoder to get the embeddings for the entire training dataset and stored them into separate pickle files. At the test time, we passed two images of each language, one seen and one unseen, and calculated the distance using the cosine similarity from embedding vectors of training images. Subsequently, we selected the three images closest to query images based on a similarity value, as shown against all query images in Figure 6. It can be observed that the model precisely recommends the same style for seen style and the closest style images for unseen styles. This indicates that the contrastive-based approach is effective in learning the semantics of individual font styles and can be used to recommend similar font styles to users. Figure 6: Recommended similar images of query image in Chinese, English, and Korean font styles on seen and unseen images during training based on cosine similarity. Caption of each image shows similarity score to query image, style number, and character number. The results presented in Table 2 demonstrate the effectiveness of using contrastive learning for few-shot fine-tuning of a pretrained model on new font styles. Compared with the fully supervised method, the contrastive-based approach achieved higher training and test accuracies for all the numbers of shots considered. For instance, when only 50 shots were used for fine-tuning, the contrastive-based method achieved a training accuracy of 93.0% and a test accuracy of 82.0%. In contrast, the fully supervised method only achieved a training accuracy of only 89.0% and a test accuracy of only 35.0%. As the number of shots increased, the contrastive-based method continued to outperform the fully supervised method, achieving test accuracy of 96.3% with 250 shots, compared with 74.4% for the fully supervised method. These results highlight the potential of contrastive learning in improving the robustness and adaptability of font style classification models, particularly when learning new styles with limited data.