## 3 Results  
Table 3 presents the performance metrics for the six models. Among the CNNs, DenseNet-169 stands out with an accuracy of 85.3% and an F1-score of 84.7%, outperforming both its deeper variant, DenseNet-201, and the ResNet model, which achieves an accuracy of 82.5% and an F1-score of 81.6%. The significant performance gap between ResNet and DenseNet models is noteworthy. Despite ResNet having substantially more parameters (127 M) compared to DenseNet-169 (14 M), it does not surpass it in performance. This seemingly counterintuitive result can be attributed to the efficient architectural design of DenseNets, which optimize parameter utilization. In fact, DenseNets have demonstrated particular effectiveness on small-sized datasets, as evidenced in studies such as [26], where DenseNet models outperform ResNets on datasets like CIFAR-10 and CIFAR-100. This suggests that DenseNets are particularly suited for smaller datasets, leveraging their parameter efficiency as a key advantage. Furthermore, examining Table 3, it becomes evident that ViTs consistently outperform all CNN models. When comparing ViT architectures with CNNs, the attention mechanisms in ViTs clearly provide an advantage over the convolutional structures of traditional CNNs. However, ViTs have significantly more parameters, which leads to greater computational demands. For example, the top-performing ViT model, ViT_h_14, has 632 million parameters, whereas DenseNet-169, the best CNN model, has only 14 million. This substantial difference makes training ViTs more resource-intensive, but given their superior performance, we believe the investment is justified. In terms of concrete outcomes, a trend appears where deeper ViT architectures yield better performance, with ViT_h_14 achieving the highest accuracy of 92.7% and an F1-score of 92.4%, even surpassing state-of-the-art models, as discussed in Section 4. Notably, the large ViT variant, ViT_16, does not significantly benefit from its additional parameters, a phenomenon noted in [28]. The architectural similarity between ViT_b_16 and ViT_16, aside from differences in embedding dimensions, layers, and attention heads, highlights the challenge of achieving substantial performance gains simply by scaling model size. The detailed analysis of Table 3 underscores the superior performance of the ViT_h_14 model, which consistently outperforms its counterparts across multiple metrics. To solidify these insights, we conducted a rigorous hypothesis test, which confirmed, with 99% confidence, that ViT_h_14 significantly outperforms all other models. This statistical validation reinforces our conclusion that ViT_h_14 represents a substantial advancement in model performance. Table 4 displays the F1-scores for each class separately. Analyzing these values, one can observe that UML component diagrams are the hardest class to deal with, displaying a F1-score value consistently over 10% lower comparing with the rest of the UML diagrams. This can be due to the fact that UML symbols used to represent component diagrams have evolved between UML versions, from UML 1.x to UML 2.x. This presents a challenge for the classification of images containing UML diagrams. Nonetheless, an F1-score value of almost 83% was achieved when classifying UML component diagrams using ViT_h_14. In addition, to provide a more visual comparison of the results obtained, Figure 2 presents the F1-score metrics for each diagram class. Analyzing this figure, it can be observed that, for sequence diagrams, use case diagrams, and class diagrams, all tested models delivered similar results. The F1-score outcomes for activity diagrams were more varied, with a noticeably better performance from the three ViTs compared to the CNN architectures. However, the most pronounced differences occurred with component diagrams. Although ViTs also outperformed CNNs in this case, it is especially clear that the ViT_h_14 model achieved significantly better results than all other models.