## 2 Method
### Neural Network Training  
As next steps, we scaled the data. Typically, the values in an image dataset are pixel intensity values, which usually range from 0 to 255 for each color channel (red, green, blue) in an 8-bit image. By dividing these values by 255.0, the code normalizes the pixel values to a range between 0 and 1. Neural networks work better when the input values are in a consistent range, typically between 0 and 1 or \(-1\) and 1. Normalized data helps in faster convergence during gradient descent. It helps in stabilizing and speeding up the training process because it ensures that the weights and biases of the neural network adjust at similar scales. Large input values can lead to numerical instability, making it harder for the model to converge or leading to very high losses initially. By scaling the values down, it prevents potential issues related to large input values. Many machine learning algorithms, including neural networks, perform better when the input features are normalized. This is because normalization helps in maintaining the relationship between different pixel values and ensures that the training process gives equal importance to all features. Consider an example of an image with the following pixel values: \begin{tabular}{c c} \hline \hline \([\)\(0,\,0,\,0\)\(]\) & \([\)\(0,\,255,\,0\)\(]\) \\ \hline \hline \([\)\(255,\,255,\,255\)\(]\) & \([\)\(0,\,0,\,255\)\(]\) \\ \hline \hline \end{tabular}   
The pixel values will be scaled to: \begin{tabular}{c c} \hline \hline \([\)\(0,\,0,\,0,\,0\)\(]\) & \([\)\(0,\,1,\,0,\,0\)\(]\) \\ \hline \hline \([\)\(1,\,0,\,1,\,0\)\(]\) & \([\)\(0,\,0,\,0,\,1.0\)\(]\) \\ \hline \hline \end{tabular}   
Figure 1: Dataset distribution per category: (**a**) UML diagram types (**b**) UML vs. non-UML. By scaling the data in this manner, one ensures that the input values are in a range that is more suitable for training a neural network, leading to better performance and more stable training. Before defining the neural network, it is good practice to display a random image from the dataset to make a final check that the data are in good condition to be used during the training phase. This step helps verify that the images are correctly preprocessed and normalized, ensuring they are suitable for input into the neural network. Using a Multi-Input Multi-Layer Perceptron (MLP) as a neural network for a feature-based dataset is an approach that leverages the power of deep learning to handle complex, multi-dimensional data. Given that the project focuses on feature extraction from UML diagrams, an MLP is ideal for processing these predefined features rather than relying on raw image data. This architecture is computationally less intensive compared to more complex models like convolutional networks, making it well-suited for projects with smaller datasets and structured features, ensuring faster training times. Additionally, the multi-layer structure of the MLP enables the model to capture non-linear relationships between diagram features, which is crucial for accurate classification. For feature-based datasets, where the input consists of various types of features (e.g., numerical, categorical, text), a Multi-Input MLP can be particularly effective. In such networks, different types of input features are often processed through separate sub-networks (sub-MLPs) tailored to each feature type. These sub-networks extract relevant information from each feature type before merging their outputs in a concatenation layer, which is subsequently fed into additional hidden layers for further processing. This architecture allows the model to handle heterogeneous data efficiently and learn from the combined information in a cohesive manner [17; 18]. The training process of a Multi-Input MLP involves adjusting the weights of the neurons using backpropagation and gradient descent.