## 2 Materials and Methods
### UML Diagram Classification  
After meticulously constructing our dataset to ensure it is free of duplicates, we used it to train and assess several deep learning classifiers, with the aim of demonstrating that our curated dataset serves as a foundation for training and evaluating different models. It should be noted that highly satisfactory results were obtained compared to those presented in other works in the literature, which demonstrates the quality and utility of our dataset. In particular, after conducting several preliminary model trials, we selected the following CNN models: DenseNet-169 [26], DenseNet-201 [26], and ResNet-152 (2 nd Version) [27], and the following ViTs [28]: ViT_b_16 (base version, 16 px patch), ViT_16 (large version, 16 pixels patch), and ViT_h_14 (huge version, 14 pixels patch). For all these architectures, transfer learning was employed using the pre-trained weights from the \"ImageNet 1K\" benchmark dataset developed by Stanford University [29]. Table 2 summarizes the main characteristics of the deep learning models used, that is, their respective families, their number of parameters (indicative of model complexity), and their image resolution requirements. As this table shows, all CNN models demand a fixed resolution of 224 \(\times\) 224 px. In contrast, ViT transformers offer greater flexibility, with the minimal resolution requirements being 224 \(\times\) 224 pixels for the base and large versions, and 518 \(\times\) 518 pixels for the huge version. In terms of model depth, the most conservative architectures are DenseNets, which achieve a remarkable efficiency with a maximum of 20 million parameters. In contrast, ViT models substantially surpass CNNs in terms of parameter count, except for ResNet-152, which also exceeds the hundred-million mark. To increase our dataset size, data augmentation functions were applied to the images before inputting them into the models. These techniques included random rotations up to 30 degrees, along with random horizontal and vertical flips. Afterwards, the augmented images were converted into tensors and immediately normalized for training efficiency and stability. Then, the dataset was randomly divided into five equal parts and a 5-fold cross-validation approach was employed for the training and evaluation of the models. Finally, it should be highlighted that the image size was adjusted to meet the input requirements of \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Family** & **Num. of Params** & **Image Resolution** \\ \hline DenseNet-169 & CNN & 14 M & 224 \(\times\) 224 px \\ DenseNet-201 & CNN & 20 M & 224 \(\times\) 224 px \\ ResNet-152\_V2 & CNN & 127 M & 224 \(\times\) 224 px \\ ViT\_b\_16 & ViT & 87 M & 224 \(\times\) 224 px \\ ViT\_l\_16 & ViT & 305 M & 224 \(\times\) 224 px \\ ViT\_h\_14 & ViT & 632 M & 518 \(\times\) 518 px \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Presentation of models’ architecture. the models; that is, 224 \(\times\) 224 pixels for all the models except for vit_h_14, which requires a minimum of 518 \(\times\) 518 pixels, as previously mentioned. Regarding the transfer learning, it should be pointed out that, in the semi-trainable transfer learning (STTL) approach [30], the feature extractor component (in CNNs), and the image embedding section along with the encoder transformer (in ViTs), maintain their pre-defined weights by freezing their values during training. Reversely, the classifier component (in CNNs) and the classification head (in ViTs) are replaced with a multi-layer perceptron (MLP) block [31], which is the only block that is fine-tuned during training. This MLP block consists of three fully connected layers with 1000, 512, and 6 neurons, respectively, each connected by a ReLU activation function [32] and incorporating dropout regularization with a probability of 0.2 to mitigate overfitting.