###### Abstract  
Font is a crucial design aspect, however, classifying fonts is challenging compared with that of other natural objects, as fonts differ from images. This paper presents the application of contrastive learning in font style classification. We conducted various experiments to demonstrate the robustness of contrastive image representation learning. First, we built a multilingual synthetic dataset for Chinese, English, and Korean fonts. Next, we trained the model using various contrastive loss functions, i.e., normalized temperature scaled cross-entropy loss, triplet loss, and supervised contrastive loss. We made some explicit changes to the approach of applying contrastive learning in the domain of font style classification by not applying any image augmentation. We compared the results with those of a fully supervised approach and achieved comparable results using contrastive learning with fewer annotated images and a smaller number of training epochs. In addition, we also evaluated the effect of applying different contrastive loss functions on training. contrastive learning; font style; multilingual font style; font classification +
Footnote †: journal: Medical  
methods use classifiers to learn different styles, they primarily focus on font generation rather than style classification. Self-supervised methods, in contrast, do not require any labels created by humans. As the name suggests, the model learns to supervise itself. In computer vision, the most typical technique to represent this self-supervision is to take various cropped images or apply different augmentations on images before feeding the modified inputs through the model. Even if the image has the same visual information but does not appear identical, [PERSON] et al. [10] presented a contrastive learning framework based on metric learning [11; 12; 13]; they trained the model so that these images still contain the same visual information, i.e., the same item, even though they appear different. This results in the model learning a comparable latent representation (an output vector) for identical items in a label-free environment. Later, [PERSON] et al. [14] extended [PERSON]'s work [10] in a supervised setting and used class labels to draw more positive images instead of using only one positive image. In self-supervised contrastive learning, for every anchor image, there is only one positive image (i.e., an augmented image) in the entire batch. However, as demonstrated in [10; 14], it cannot be directly applied to the font domain by simply applying augmentations [15; 16] on training images. As shown in Figure 1, flipping a font image horizontally or vertically results in different image contents, i.e., flipping 'R' horizontally results in an undefined character. Because of this reason, the application of contrastive learning in the font domain, in general, and font style classification in particular, has remained largely underexplored. On unlabeled data, contrastive learning learns generic representations of images, which may subsequently be fine-tuned with a limited number of labeled images to achieve acceptable performance for a specified classification problem, in this case, font style classification. The generic representations are learned by maximizing the agreement between multiple transformed views of the same image, while simultaneously reducing the agreement between transformed views of different images. When the parameters of a neural network are updated using this contrastive aim, comparable view representations \"attract\" each other while noncorresponding view representations \"repel\" each other. Therefore, the model learns the similarities between two inputs instead of learning how to classify the input images. Therefore, we used Normalized Temperature-scaled Cross-Entropy Loss (NT-Xent) [17], Triplet Loss [18], and Supervised Contrastive Loss functions [14]. Another important problem in font style classification is the ability to learn new styles over time.