###### Abstract  
UML (Unified Modeling Language) diagrams are graphical representations used in software engineering which play a vital role in the design and development of software systems and various engineering processes. Large, good-quality datasets containing UML diagrams are essential for different areas in the industry, research, and teaching purposes; however, few exist in the literature and it is common to find duplicate elements in the existing datasets. This might affect the evaluation of the models obtained when using these datasets. This paper addresses the challenge of creating a ground truth dataset of UML diagrams, including semi-automated inspection to remove duplicates and ensuring the correct labeling of all UML diagrams contained in the dataset. In particular, a dataset of six UML diagram classes was assembled, comprising a total of 2626 images (426 activity diagrams, 636 class diagrams, 352 component diagrams, 357 deployment diagrams, 435 sequence diagrams, and 420 use case diagrams). Importantly, unlike other existing datasets, ours contains no duplicate elements and all diagrams are correctly labeled. Our curated dataset is a valuable and unique resource for the research community, serving as a foundation for training and evaluating diverse artificial intelligence models. In this paper, we demonstrate this by training and testing several deep learning models using our dataset, achieving highly satisfactory results compared to those presented in other works in the literature. Additionally, our experimental results highlight the potential of visual transformers for UML diagram classification, setting our approach apart from others that predominantly used convolutional neural networks for similar tasks. UML diagram dataset; UML diagram classification; deep learning; convolutional neural networks; vision transformers +
Footnote †: journal: applied sciences  
0000-0001-5000-0002][PERSON]  
0000-0001-5000-0001-5000][PERSON]  
0000-0001-5000-0001-5000]J.  
highly mature language, with its latest stable version, 2.5, addressing a broad spectrum of engineering needs. UML supports applications such as workflow representation in DevOps and continuous integration environments, microservices architecture design (for example, using sequence diagrams to effectively represent service interactions), and reverse engineering for structuring and organizing software code. Even in Agile and iterative development contexts, where flexibility often supersedes exhaustive documentation, UML offers a lightweight, logical framework that aligns well with Agile methodologies. In Agile, UML is often used through simplified class diagrams to represent conceptual structures and use case diagrams to capture high-level interactions. This adaptability makes UML suitable for Agile by providing a visual, communicative tool that complements iterative workflows without impeding flexibility [8; 9; 10; 11; 12]. Considering UML's continued relevance and the fact that most UML diagrams are shared as images, the availability of a high-quality, well-curated dataset of UML diagrams becomes crucial. Since UML diagrams are frequently shared as images rather than editable models, having a dataset free from duplicates and misclassifications is essential for training machine learning models effectively. Such a dataset not only facilitates tasks such as accurate UML diagram classification but also opens up opportunities for developing advanced software engineering tools. For instance, a comprehensive and organized dataset could enable the creation of a sophisticated search engine for UML diagrams. This search engine would allow software engineers to search for diagrams by content, using model snippets as queries, rather than relying on keywords. This capability could greatly facilitate the reuse of models, accelerating design processes and enhancing efficiency in software development projects.