## 2 Materials and Methods
### Dataset Creation  
To build our dataset, we used the dataset presented in [18] as a seed. This dataset is composed of the six most commonly used categories of UML diagrams (class, use case, sequence, component, activity, and deployment diagrams), with 250 images for each UML diagram category. Despite the valuable resource that this dataset represents for the scientific community, it contains several duplicate images in terms of content, even though the files are not exact copies (as shown in Figure 1, as an example). One of the goals of our work was not only removing these duplicate images, but also acquiring additional images to increase the size of the dataset.  
Thus, our first step was obtaining additional UML diagram images. To do so, web scraping was applied using a Google Add-In, enabling an almost instant download of a huge volume of images. In this process, queries for the six UML diagram classes from the repository presented in [18] were executed on Google Images ([[https://images.google.com/](https://images.google.com/)]([https://images.google.com/](https://images.google.com/)), accessed on 1 June 2023) to collect new images. In this process, two distinct problems arised: the redundancy of images and the issue of the class appropriateness, where images retrieved did not match the specific types of UML diagrams being searched. To address these problems, filtering and removal of misclassifications were meticulously performed through visual inspection. Although this human supervision may appear to be a slight weakness in the process because of the lack of automation and the time consumption, it remains crucial for ensuring data quality, which is critical and can make a big difference in the performance and generalization of the models trained using these data.  
To assist us in this intricate task, we used the \"Duplicate Cleaner Pro\" program (version 4.1.3) [25], which matches images based on a user-defined similarity threshold and allows for searching for repeated images based on their content, even if the files are not identical. This application uses a visual comparison technique to identify images that have undergone rotation, flipping, retouching, resizing, or format conversion. Additionally, it allows users to set the level of precision or tolerance for comparison, displaying clusters of potential duplicates for manual inspection and verification. In our filtering process, we applied several thresholds to detect duplicate diagrams: first, nearly exact matches were removed with a high similarity threshold (around 80%). The threshold was then gradually lowered until reaching 20% similarity, at which point only a few duplicates remained; the majority of diagrams were similar but not close enough to be considered duplicates. Finally, it should be noted that this filtering process resulted in the removal of approximately three out of every four images gathered, both from the seed dataset and from the web scraping process.  
After making sure that the created dataset had no repeated elements and that all diagrams were correctly labeled, the UML diagram images were converted to grayscale, saved in JPEG format, and standardized to a uniform resolution. Our final dataset consists of 2626 images across six UML diagram types: activity (426), class (636), component (352), deployment (357), sequence (435), and use case (420) diagrams. It is important to note that all UML diagrams are different and have been correctly categorized by diagram type, ensuring the reliability of our dataset.