## 3 Results
### Model Evaluation and Testing
The ability to save and load models in this way ensures that the training process is reproducible and that models can be consistently utilized across different platforms and systems. By using the.h5 format, users can efficiently manage their trained models and ensure that they are ready for deployment or further analysis. Figure 3: Training and validation: (**a**) accuracy (left) and (**b**) loss (right) from last execution. The project progressed through multiple phases to achieve a robust image classification system. Initially, data collection and preprocessing were conducted to ensure high-quality inputs for the model. The next phase involved designing and training a neural network using the Adam optimizer and sparse categorical crossentropy loss function, with accuracy as the evaluation metric. After thorough evaluation and optimization, we developed a custom prediction function. This function takes a tested image and utilizes the trained model to classify the image accurately. The custom predict function streamlines the deployment process, ensuring that the model can be effectively used for real-time image classification tasks. This approach was iteratively refined based on testing and validation results, ensuring high performance and reliability in the classification system. During the entirety of the research, we kept 25 samples to compare results across experiments. The samples consisted of five class diagrams, five state diagrams, five sequence diagrams, five other UML diagrams, and five images unrelated to UML diagrams. Each UML sample consisted of an entire image in the.pdf or.jpg format with no constraints on a fixed size. For the current experiment, we obtained the following results: 18 images correctly classified as true positives, 2 images as false positives, 3 false negatives, and 2 true negatives. All the edge cases that we tracked during research were correctly classified. In order to help the model generalize well, we considered all features that could be a part of each UML category, especially the diagram types we focused on classifying. In order to support the correct classification, we focused on specific features. One edge case we focused on was a Generic Modeling Environment against UML class diagrams, where many features are similar. However, there are features that indicate that the difference as well as connection between components may highlight why a certain diagram falls into a specific category. For the non-UML category, we focused on bringing these features in so the model could capture these details and make the right classification. To further evaluate the robustness of our model, we tested its performance under varying conditions. The model was tested on images with added noise to simulate low-quality images containing UML diagrams. The accuracy decreased slightly by 1.2%, demonstrating that the model is robust to image quality variations. We introduced small random rotations and scaling variations to the input images. This could map to a scenario where the image comes from a scanned paper where the image is not always straight. The model retained an accuracy of 87.8%, showing its ability to handle variations in input data. The current model is aimed to be used for educational purposes. First, by looking at features, the model can support identifying syntax errors what would mark the diagram to no longer be part of the intended category. Additionally, it could be integrated to identify similar diagrams among students to support faster evaluation and ensure integrity and ethical standards.