## 2 Method
### Build the Feature Dataset  
We manually extracted parts of UML diagrams using the built-in macOS screenshot tool, which also helped define the file locations. First, we opened the UML diagram on our screens, with images which were previously downloaded as described above. By pressing Command + P, a custom shortcut, we activated the screenshot tool, changing the cursor to a crosshair. We then clicked and dragged to select the area of the UML diagram we wanted to capture. Upon releasing the mouse button, the screenshot was taken and automatically saved to the desired location. The file locations were clearly indicated as the screenshots were named with timestamps and saved in a predefined folder, ensuring easy retrieval and organization of the extracted parts.  
To conduct training on a feature-based dataset, specific parts of the diagrams must be extracted. For UML diagrams, this involves identifying and isolating key modeling concepts such as classes, interfaces, relationships, and other elements defined in the UML specification. Examples of features are listed in Table 3 below and follow the guidance and official naming of modeling elements from [10]. These elements are then converted into feature vectors that can be fed into the neural network for training.  
Non-UML diagrams were sourced from the same Google Images Search [14] using a custom Python script. This script leverages the Google Custom Search API to retrieve images that match specific keywords related to diagrams that are not UML, but close to the UML definition. These include Business Process Model and Notation (BPMN), Generic  
\begin{table}
\begin{tabular}{l l l l} \hline \hline  & **Class Diagram** & **Sequence Diagram** & **State Diagram** \\ \hline \multirow{8}{*}{**Features**} & Class & Lifeline & State \\  & Abstract Class & Actor & Initial State \\  & Interface & Message & Final State \\  & Nested Classifier & Synchronous Message & Composite State \\  & Object & Asynchronous Message & Substate \\  & Enumeration & Create Message & Entry Point \\  & Association & Destroy Message & Exit Point \\  & Operation & Return Message & Transition \\  & Constraint & Combined Fragment & Trigger \\  & Multiplicity & Interaction Use & Guard \\  & Composite & Execution Specification & Action \\  & Aggregation/Composition & State Invariant & Self-Transition \\  & Association Navigability & Continuation & Fork Node \\  & Generalization & Time Constraint & Join Node \\  & Dependency & Duration Constraint & Choice Node \\  & & Junction Node \\  & & & History State \\  & & Termination \\ \hline \hline \end{tabular}
\end{table}
Table 3: UML diagram features introduced in the training dataset.  
Modeling Environment (GME), Entity-Relationship Diagrams (ERDs), and Data Flow Diagrams (DFDs).  
The non-UML diagram dataset followed these steps:  
1. Enable the Google Custom Search API
2. Configure search parameters: The script is configured to search for keywords like \"BPMN diagram\", \"ERD diagram\", \"DFD diagram\", and \"GME diagram\".
3. Download images: The script downloads the images matching these keywords and saves them in a predefined directory for further processing.  
Additionally, to ensure a robust training dataset, manual curation was performed. This included adding samples that resemble UML diagrams but are not strictly UML. These samples help the model to learn subtle differences and avoid misclassification.